What is RTInfo?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 29 06:55:00 PST 2015


On Thursday, 29 January 2015 at 08:47:18 UTC, Mike wrote:
> It just seems to return a void*.  But, searching the source 
> code, it doesn't seem to be set by anything anywhere.

It can actually return anything: RTInfo is a template that is 
automatically instantiated for each user-defined struct or class 
in a program.

https://github.com/D-Programming-Language/druntime/blob/f0c1e13d8bd547eed517b1ae17f085966bb165c1/src/object.di#L682


It isn't actually doing anything yet in the lib, but it could if 
you wanted to modify druntime. IT can do anything - custom, user 
extensions to TypeInfo, building trees of types, or making maps 
of things for the GC (which is why it is there, just nobody has 
actually used it yet). It is one of the cool hidden gems there 
that is unutilized so far.


More information about the Digitalmars-d-learn mailing list