Comparison chart of D and C++ templates

Walter Bright newshound at digitalmars.com
Sat Jan 20 13:29:56 PST 2007


janderson wrote:
> Sorry, I mean like:
> 
> template <class C>
> void Get(C& c) {}
> 
> ...
> int X = 0;
> Get(X);
> 
> float Y = 0;
> Get(Y);
> 
> No need to specify the types.

You can certainly pass global symbols like that as template arguments in D.



More information about the Digitalmars-d-announce mailing list