Changing the template defintion syntax.

Robert DaSilva sp.unit.262+digitalmars at gmail.com
Sat Dec 15 13:09:52 PST 2007


One thing that has bugged me for a while is the in symmetry of how
template are defined and used. If template were defined with !() instead
of () it would also allow multi-level template to be defined with out
the "same name as template" kludge.
For example
U to!(U)!(T)(T t);
And while on the note of to, it would be nice if cast used template
syntax (as well as any keyword function that took or returned types
(const, invariant, typeof, typeid, etc.)).

Also the template keyword could be replace with a generic namespace keyword.

We could even let all definitions be templatable
T template_variable!(T);
I don't know how practicable or use full that would be though.



More information about the Digitalmars-d mailing list