How to get to a class initializer through introspection?

Adam D. Ruppe destructionator at gmail.com
Tue Aug 4 02:35:12 UTC 2020


On Tuesday, 4 August 2020 at 02:09:13 UTC, Andrei Alexandrescu 
wrote:
> Oh, yes forgot about that important efficiency matter. Yes it 
> does look like we need a __trait after all.

How do you think it should be exposed? An initialization function 
the compiler generates? Some kind of range of ranges? (so like a 
representation of "4 bytes of zero, 5000 bytes uninitialized, 4 
bytes of 4s". Though at that point a .tupleof may make more 
sense, just gotta account for hidden fields too like the class 
vtable pointer.)

I'm thinking the function is probably the best though then 
tweaking it becomes a compiler patch again. It would also want to 
be guaranteed to be inlined probably.

I don't know though, it is kinda tricky to actually account for 
those =void things.


More information about the Digitalmars-d mailing list