Get full class name at compile time - Not yet implemented

Andre via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Nov 12 21:22:37 PST 2014


Hi,

I currently have some issues to get the full class name at 
compile time by the variable which might point to null.
With .stringof I get the class name without the module. It seems 
typeid(typeof())
is the solution, but DMD throws the error:

source\app.d(10): Error: &typeid(app.A).name is not yet 
implemented at compile t
ime

Do I have any other possibilities?

Kind regards
André

module app;

class A {};

void main()
{
	A a;

	pragma(msg, typeof(a).stringof); // A
	pragma(msg, typeid(typeof(a)).name); // Should print app.A
}


More information about the Digitalmars-d-learn mailing list