class A
{
void showMyName()
{
writefln("name = [%s]", __traits(identifier, typeof(this)));
}
}
class K : A { }
then
new K().showMyName();
output:
name = [A]
I'd like to output K
and get this identifier at compile time. But I'd to do so automatically so rule out something like:
class A
{
string name = __traits(identifier, typeof(this));
void showMyName()
{
writefln("name = [%s]", name);
}
}
class K : A
{
this()
{
super.name = __traits(identifier, typeof(this));
}
}