00001 #ifndef realroot_BASE_TYPE_DEMANGLE_H
00002 #define realroot_BASE_TYPE_DEMANGLE_H
00003
00004 namespace mmx {
00005
00006 namespace texp
00007 {
00008 template<class X> inline
00009 const char * name() {
00010 size_t len;
00011 int status;
00012 return abi::__cxa_demangle( typeid(X).name(), 0, &len, &status );
00013 };
00014
00015 template<class X> inline
00016 std::ostream& print( std::ostream& o )
00017 {
00018 size_t len;
00019 int status;
00020 o << abi::__cxa_demangle( typeid(X).name(), 0, &len, &status );
00021 return o;
00022 };
00023
00024
00025 template<class X>
00026 struct TYPE {};
00027 template<class X>
00028 inline std::ostream & operator<<( std::ostream& o, const TYPE<X>& t )
00029 {
00030 return print<X>( o );
00031 };
00032 };
00033
00034 }
00035
00036 #endif