Hi, first post here!
When I need to get the class name inside of one of its methods I just call:
typeid(*this).name()
(then I split the result into tokens and get the class name)
Now I have to define a static member variable and need to get the class name for that. But I`m not in a method! So, I cannot use (*this).
Initially, I thought I could do something like:
#define INIT_STAT_VAR
const char * cname = typeid(*this).name;
int cname##::var = 1;
Any idea how I could get the class name for the static member variable definition? ( no, I cannot just write the name of the class directly for the definition ;] )
thanks!