Printing type name in static assert

Martin Cejp minexew at gmail.com
Sat Jan 25 03:28:38 PST 2014


I'm trying to do something to this effect:

template XYZ(Class) {
...
static assert(index != -1, "No such annotation on " ~ 
typeid(Class));
...
}

However, typeid is not a string and I can't do to!string. Nor is 
typeid().name implemented at compile time.
What would be the correct way to do this?


More information about the Digitalmars-d mailing list