Get class name of C++ class at runtime

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 7 06:02:46 PDT 2016


On 07/07/16 12:31, Namespace wrote:

> Maybe with a template?
>
> ----
> void class_name(T)(T obj) if (is(T == class)) {
>      writeln(T.stringof);
> }
> ----

I want the string of the runtime type, the most derived type.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list