stringof of an TemplateAliasParameter
Matthias.Walter at st.ovgu.de
Sun May 18 12:33:35 PDT 2008
suppose you have the following template:
| template Foo (alias X)
| const char Foo = X.stringof ~ " = null;";
... and instanciate it with a struct member ...
| mixin (Foo !(mystruct.member));
... this code becomes "member = null;", although I'd like it to be "mystruct.member = null;" Is this intended behavior? .stringof seems to return only sort of a short version of the name.
Of course I could make my template accept a string "mystruct.member" instead of an alias to make it work, but I thought this would be more comfortable to let the user call my mixins with variables instead of strings, containing variables! Or is there another way to achieve my needs?
More information about the Digitalmars-d-learn