Get name of alias parameter at compile time?

Lutger lutger.blijdestijn at gmail.com
Thu Oct 15 09:00:52 PDT 2009


Bah, I replied too soon. These also work, makes sense now I think about it:

void doStuff(int a ) {}

void templ(alias fun)()
{
    writeln( (&fun).stringof[2..$] );  // prints doStuff (really)  
    writeln( fun(int.init).stringof ); // prints doStuff(0) 
}





More information about the Digitalmars-d mailing list