Created
August 11, 2012 15:05
-
-
Save yangacer/3325136 to your computer and use it in GitHub Desktop.
gcc demangling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <typeinfo> | |
#include <memory> | |
#ifdef __GNUC__ | |
#include <cxxabi.h> | |
template<typename T> | |
struct getname | |
{ | |
std::string operator()() | |
{ | |
int status(-4); | |
std::shared_ptr<char> res(abi::__cxa_demangle(typeid(T).name(), 0, 0, &status)); | |
return (res) ? res.get() : typeid(T).name(); | |
} | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment