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

Stefan Koch uplink.coder at googlemail.com
Tue Feb 18 10:38:03 UTC 2020


On Tuesday, 18 February 2020 at 03:33:21 UTC, Basile B. wrote:
> On Monday, 17 February 2020 at 22:34:31 UTC, Stefan Koch wrote:
>>
>> Upon seeing this I just implemented typeid(stuff).name;
>>
>> https://github.com/dlang/dmd/pull/10796
>>
>> With any luck this will be possible in the next release ;)
>
> Can this work using `stuff.classinfo.name` too ?
> This is the same as `typeid(stuff).name

Currently no. It's represented differently in the end tree.





More information about the Digitalmars-d-learn mailing list