Fixed type name extraction

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@70 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2009-12-09 23:08:54 +00:00
parent d0bda73778
commit eb78cf942e
3 changed files with 76 additions and 12 deletions

View file

@ -43,27 +43,21 @@ namespace detail
guard g( result );
if( result )
return result;
else
return name;
#else
return name;
#endif
}
template< typename T >
std::string type_full_name()
{
return type_full_name( typeid( T ) );
return name;
}
template< typename T >
std::string type_name()
{
const std::string name = type_full_name< T >();
const std::string name = type_full_name( typeid( T ) );
std::size_t p = name.rfind( "::" );
if( p != std::string::npos )
return name.substr( p + 2 );
return "";
p = name.rfind( " " );
if( p != std::string::npos )
return name.substr( p + 1 );
return name;
}
}
}