К вашему сведению: g ++ предлагает нестандартное __ PRETTY_FUNCTION __ макрос. Пока сейчас я не знал о C99 __ func __ (благодарит Evan!). Я думаю, что все еще предпочитаю __ PRETTY_FUNCTION __, когда это доступно для дополнительного обзора класса.
пз:
static string getScopedClassMethod( string thePrettyFunction )
{
size_t index = thePrettyFunction . find( "(" );
if ( index == string::npos )
return thePrettyFunction; /* Degenerate case */
thePrettyFunction . erase( index );
index = thePrettyFunction . rfind( " " );
if ( index == string::npos )
return thePrettyFunction; /* Degenerate case */
thePrettyFunction . erase( 0, index + 1 );
return thePrettyFunction; /* The scoped class name. */
}
Check out this article for a good paragraph description of what omit norms does in term of optimisation. Basically its kind of like having a mini lucene index for the terms inside of a field, so its really only useful for fields that would have a lot of text inside them.