So Chris Blackwell pointed me in the right direction, and we now have
#include <cxxabi.h>which returns a human-readable name.
template <typename ObjType> std::string class_name(ObjType* anObject)
{
int status;
char *realName;
realName = abi::__cxa_demangle(typeid(*anObject).name(), 0, 0, &status);
std::string retVal(realName);
free(realName);
return retVal;
}
No comments:
Post a Comment