D's templates now seem weak to me...

Sean Kelly sean at f4.ca
Mon Feb 20 10:41:11 PST 2006


Ben Phillips wrote:
> According to the docs, "Templates cannot be used to add non-static members or
> functions to classes. For example: [...]". Why? This is just plain stupid in my
> opinion

It's also not entirely true.  Templates cannot be used to add virtual 
members or functions to classes, but they can add (implicitly final) 
non-static membes to classes.  This is the same as in C++.


Sean



More information about the Digitalmars-d mailing list