Unmangling the result of std::type_info::name

Posted by terminus on Stack Overflow See other posts from Stack Overflow or by terminus
Published on 2008-11-11T18:52:31Z Indexed on 2010/05/11 1:14 UTC
Read the original article Hit count: 219

Filed under:
|
|

I'm currently working on some logging code that supposed to - among other things - print information about the calling function. This should be relatively easy, standard C++ has a type_info class. This contains the name of the typeid'd class/function/etc. but it's mangled. It's not very usefull. I.e. typeid(std::vector).name() returns "St6vectorIiSaIiEE".

Is there a way to produce something usefull from this? Like 'std::vector' for the above example. If it only works for non-template classes, that's fine too.

The sollution should work for gcc, but it would be better if I could port it. It's for logging so it's not so important that it can't be turned of, but it should be helpfull for debugging.

© Stack Overflow or respective owner

Related posts about c++

Related posts about gcc