Why defining alias and not auto when using a template?

Bienlein jeti789 at web.de
Fri Apr 4 06:35:57 PDT 2014


> "auto" is used to declare an instance, or an object.
> "alias" is used to declare a name.
>
> What you are currently doing is saying "the function 
> TCopy!(int, int) can now be refered to as myCopy". You aren't 
> actually creating any data.

All right, thanks. Then I create an instance:

auto myCopy = new TCopy!(int, int);	
alias myCopy = new TCopy!(int, int);	

Neither nor compiles now. How can? Seems to me a template is not 
a class in that sense ?!



More information about the Digitalmars-d-learn mailing list