Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <typeinfo>
- #include <cxxabi.h>
- #include <cstdlib>
- #include <string>
- std::string getReadableTypeinfo(const char* info)
- {
- int status;
- char* s=abi::__cxa_demangle(info, /*nullptr*/NULL, /*nullptr*/NULL, &status);
- if (status != 0)
- return "Invalid argument";
- std::string result = s;
- free(s);
- return result;
- }
- int main()
- {
- using namespace std;
- cout << getReadableTypeinfo(typeid(getReadableTypeinfo).name()) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement