If I defined a class:
class Blah {};
How can I:
std::string const className = /* What do I need to do here? */;
assert( className == "Blah" );
I dont think typeid().name() is a good idea since it's compiler implementation specific. Is there anything provided by the C++ standard or Boost?
Note: If the class were inherited from Qt's QObject, I could easily use QMetaObject::className()
to get the class name.