As the title asks, are they any g++ builtin function (or any method) to know the class name from a class object pointer? For instance,
class Base {
};
class A : public Base {
};
class B : public Base {
};
void some_func(Base *p) {
printf("the name of class: %s", __some_g++_builtin_get_class_name(p) );
}
Similar to __PRETTY_FUNCTION__ in gcc builtin, I hope there would be a builtin function for g++ that help us analyze source code :)