C++符号解析

    C++ 符号还原(Demangling),windows/linux平台需分别处理。

#include <typeinfo>
#include <cxxabi.h>

class Foo{};

#ifndef __GNUC__   // vc
const char *real_name = typeid(Foo*[10]).name(); 
#else  // linux
char *real_name = abi::__cxa_demangle(typeid(Foo*[10]).name(), NULL, NULL, NULL);
#endif

猜你喜欢

转载自tcspecial.iteye.com/blog/2412613