C++ Symbol Resolution

    C++ symbol restoration (Demangling), windows/linux platforms need to be handled separately.

 

#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

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326063384&siteId=291194637