__typeid

Timon Gehr timon.gehr at gmx.ch
Sun Aug 2 15:34:30 UTC 2020


On 01.08.20 18:12, Andrei Alexandrescu wrote:
> 
> Reading a bit more about TypeInfo and related stuff, I figure (and 
> correct me if I'm wrong) that the entire machinery is currently used for 
> the following purposes (only):
> 
> * Built-in associative arrays (which ought to be phased out)
> 
> * Inform the GC of what it needs to scan (provided in an awkward manner 
> though, this is subject to a later discussion)
> 
> * Dynamic cast information for class objects
> 
> * Object creation for Object.factory() (which also should be phased out)

There's also its toString. I have on occasion used 
writeln(typeid(classInstance));


More information about the Digitalmars-d mailing list