Why is !() need with default template arguments

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Wed May 20 00:07:25 PDT 2009


Jeremie Pelletier wrote:
> 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.
> 

Can you do anything with a template except instantiate it?

-Lars



More information about the Digitalmars-d mailing list