Can't declare a "template parameter which takes anything"

Steven Schveighoffer schveiguy at yahoo.com
Mon Mar 17 08:59:54 PDT 2008


"Russell Lewis" wrote
> I'd like to propose that we need a template parameter syntax which means 
> "this parameter can be anything...type, alias, or value."  Currently, an 
> unadorned parameter is required to be a type, and it cannot take an alias 
> or value parameter.


Have you tried alias parameters?

template template_foreach(alias T)
...

This allows any symbol to be given 
(http://www.digitalmars.com/d/1.0/template.html#TemplateAliasParameter) I'm 
not sure if it works for literals though.

-Steve 





More information about the Digitalmars-d mailing list