123456789101112131415161718
#include <boost/core/demangle.hpp> #include <typeinfo> #include <iostream> template<class T> struct X { }; int main() { std::cout << typeid(unsigned long).name() << "\n"; std::cout << boost::core::demangle(typeid(unsigned long).name()) << "\n\n"; const auto name = typeid(X<int>).name(); std::cout << typeid(X<int>).name() << "\n"; std::cout << boost::core::demangle(typeid(X<int>).name()) << "\n"; }
unsigned long unsigned long struct X<int> struct X<int>
m unsigned long 1XIiE X<int>
name()