On Tuesday, 5 January 2021 at 21:43:09 UTC, welkam wrote:
Replace alias Bar(T) = Foo!T; with alias Bar = Foo;struct Foo(T) {} alias Bar = Foo; void f(T)(Bar!T x) {} void main() { auto foo = Bar!int(); f(foo); }
The example was a reduced case. One can trivially construct examples where that won't work.
It is very useful to create a simple alias from a complex type for export from a type library, then it breaks when people use that type library to write templated functions.
People do this all the time in C++.
