Templates

m m at m.m
Sat Aug 22 09:11:48 PDT 2009


Hello,

i'm during reading of Learnt to Tango with D. In chapter 5 (about Templates) there are few samples of using templates. I've got problem with one of them.

1. 
template List( T )
{
pragma( msg, "List( T )" );
}
template List( T : int )
{
pragma( msg, "List( T : int )" );
}
template List( T : T[] )
{
pragma( msg, "List( T : T[] )" );
}
void main()
{
alias List!(char) A;
alias List!(int) B;
alias List!(char[]) C;
}

Should produce messages (according to what is said in book):
 
List( T )
List( T : int )
List( T : T[] )

but i've got: 

List( T : int )
List( T : int )
List( T : T[])

Is there are any error, or what?

best regards
m


More information about the Digitalmars-d-learn mailing list