Why is !() need with default template arguments

Jeremie Pelletier jeremiep at gmail.com
Tue May 19 20:01:44 PDT 2009


Jacob Carlborg Wrote:

> If I have a class like this:
> 
> class Class (T = int) {}
> 
> Then why can't I use it like this:
> 
> auto c = new C;
> 
> I have to do this:
> 
> auto c = new C!();

I think it is so the parser knows how to make the difference between the template symbol and an instance symbol.




More information about the Digitalmars-d mailing list