equivalent of typeid(Class).name at compile-time

Steven Schveighoffer schveiguy at gmail.com
Thu Nov 21 20:44:19 UTC 2019


I thought I could do typeid(Class).name to get the class name that will 
be returned at runtime if you did typeid(instance).name. But it's not 
accessible at compile-time.

What compile-time string should I use for instance in a constructed 
switch statement? I'm trying to implement serialization and 
deserialization of classes, but I really would like to avoid using a 
class enum if possible, since the type id is already there and generated 
by the compiler.

-Steve


More information about the Digitalmars-d-learn mailing list