Template declaration/instantiation

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat Mar 4 08:30:44 PST 2006


"Tom" <Tom_member at pathlink.com> wrote in message 
news:duca8l$1mik$1 at digitaldaemon.com...
> Just for curiosity: why template declaration doesn't use '!()' instead of 
> '()'.
> Wouldn't using the same symbols in both (the declaration and the 
> instantiation)
> be a little more "consistent" to the sight?

It has to do with it being a context-free grammar.  That is, if templates 
just used plain old parentheses, it would take more work to determine what 
the symbol was that preceeded them.

I like !(), I see it and immediately know I'm dealing with a template.  It's 
like how <> stands out in C++ templates. 





More information about the Digitalmars-d mailing list