c++macros

Is there a __CLASS__ macro in C++?


Is there a __CLASS__ macro in C++ which gives the class name similar to __FUNCTION__ macro which gives the function name


Solution

  • The closest thing there's is to call typeid(your_class).name() - but this produces compiler specific mangled name.

    To use it inside class just typeid(*this).name()