Here are three classes,
class ClassA{};
class ClassB:public ClassA{};
class ClassC:public ClassB{};
ClassC cobject;
I want to know the cobject's "Class Name"(i.e. ClassC) and its "SuperClasses' Name"(i.e. ClassB & ClassA)
I know RTTI can do this. But I'm wondering if I can do this with a few macros.
The short answer is no, you can't do that with a few macros if you don't want to use RTTI.
However, you can get a lot of useful information about class types using templates on your own or using a library like the Boost.TypeTraits. For example, you can test if a class inherits from another using
is_base_of()