boostでdemangleする
boost/core
にはいくつかのutility系の機能がある。
boost/core/demangle.hpp
はdemangleを提供する。
使い方
#include <boost/core/demangle.hpp> #include <typeinfo> #include <iostream> template<class T> struct X { }; int main() { char const * name = typeid( X<int> ).name(); std::cout << name << std::endl; // 出力は処理系による std::cout << boost::core::demangle( name ) << std::endl; //出力はX<int> }