How to get to a class initializer through introspection?

Timon Gehr timon.gehr at
Tue Aug 4 10:57:26 UTC 2020

On 03.08.20 00:48, Stefan Koch wrote:
> On Sunday, 2 August 2020 at 22:25:19 UTC, Andrei Alexandrescu wrote:
>> I'm working on redoing typeid for classes without compiler magic, and 
>> stumbled upon the class initializer - the bytes blitted over the class 
>> before the constructor is called.
>> Any ideas on how to do that via introspection? The fields are 
>> accessible, but not their default values.
>> It seems like __traits(type, getInitializer) might be necessary.
> So you are introducing new compiler magic in the form of __traits,
> To replace the old compiler magic in the form of type-info?
> What exactly is the goal of this?

Orthogonality of magic.

More information about the Digitalmars-d mailing list