DIP8: Templating ClassInfo and TypeInfo

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Nov 2 18:20:35 PST 2009


dsimcha wrote:
> http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP8
> 
> Abstract:
> 
> Currently, the layout of D's runtime type info, or RTTI, is defined in
> object.d. The details of how the fields of each instantiation of these classes
> are populated are buried deep inside the compiler. If ClassInfo and TypeInfo
> were instead template classes inheriting from some non-templated abstract base
> class that defined the interface and field layout, any compile-time
> introspection feature could trivially be added to RTTI and made available at
> runtime.

I think ClassInfo should be merged with TypeInfo. There should be no 
more classinfo member, only e.g. meta.typeid(type) and meta.typeid(object).

Andrei



More information about the Digitalmars-d mailing list