How to get the name of an object's class at compile time?

Nathan S. no.public.email at example.com
Mon Feb 17 07:28:38 UTC 2020


What I want is something like this:

----
string className(in Object obj) {
     return obj is null ? "null" : typeid(obj).name;
}
----

...except I want it to work in CTFE. What is the way to do this 
in D?


More information about the Digitalmars-d-learn mailing list