Printing type name in static assert

Rikki Cattermole alphaglosined at gmail.com
Sat Jan 25 03:41:52 PST 2014


On Saturday, 25 January 2014 at 11:28:40 UTC, Martin Cejp wrote:
> 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?

Class.stringof perhaps?


More information about the Digitalmars-d mailing list