How can i demangle name in MSVC? There\'s abi::__cxa_demangle function in gcc. In MSDN i\'ve found UnDecorateSymbolName:
http://msdn.microsoft.com/ru-ru/library/windo
It seems UndecorateSymbolName/__unDName can't handle function-local names. If you move the class definition to the global scope, .name() will return already demangled name (use .raw_name() to get the mangled name).
To demangle the (global) raw name manually, you need two changes to your code:
1) skip the leading period in the mangled name (i.e. start at the '?').
2) instead of 0, use the flag value 0x2800 (UNDNAME_32_BIT_DECODE | UNDNAME_TYPE_ONLY).
I found this out from the CRT sources of VS2012:
if ((pTmpUndName = __unDName(NULL, (this->_M_d_name)+1, 0,
&_malloc_base, &_free_base,
UNDNAME_32_BIT_DECODE | UNDNAME_TYPE_ONLY)) == NULL)