2016-09-19 23:18 GMT+02:00 Jonathan Marler via Digitalmars-d < digitalmars-d@puremagic.com>:
> On Monday, 19 September 2016 at 21:14:38 UTC, Stefan Koch wrote: > >> On Monday, 19 September 2016 at 21:09:37 UTC, Jonathan Marler wrote: >> >>> >>> I don't know if I would call this a "destabalizing" language change >>> though. It should be backwards compatible with the existing semantics. It >>> adds an extra step to type deduction, but this would be the very last step >>> of type deduction so it would not override any existing semantics. >>> >> >> Consider void functionOrTemplate() {...} and functionOrTemplate(uint N = >> 1)() {...} >> > > Oh you're right, I didn't think that templates could share the same name > as functions. You can't do this with classes: > > class classOrTemplate { } > class classOrTemplate(uint N=1) { } > > With this new information, yes this would be a "destabalizing" language > change. Thanks for the example. I'm against this. > No you can't. The example is wrong, but Stefan is right. Consider: ``` template Foo (T = string) { } template TakesAlias(alias Sym) {} alias TakesAlias!(Foo) Bar; ``` In this context, is `TakesAlias` instantiated with the template or the template instantiation ? It is essentially the same category of problems as when trying to use a parameterless-functions, sometime you end up calling it because of the optional parenthesis. Except that for functions we can use `&` or `typeof`.