
AMDG Jeff Schwab wrote:
Thanks for pointing out the Boost version; I didn't know about it. Since the OP is using GCC, the following will also work:
The version in Boost.Units effectively does the same thing wrapped in #ifdefs to make it compile for non-GCC.
char* demangle(char const* const name, int* const status) { typedef char* buffer_pointer_t; typedef std::size_t* length_pointer_t; return abi::__cxa_demangle( name , buffer_pointer_t( ) , length_pointer_t( ) , status); }
For example, wrapping this function in a c++filt work-alike: ./main N5boost16exception_detail19error_info_injectorISt11range_errorEE boost::exception_detail::error_info_injectorstd::range_error
I've just posted sample code on GitHub; see demangle.hh and main.cc: http://github.com/jeffs/jms/tree/master/src/jms/demangle
In Christ, Steven Watanabe