C++ get the mangled names of a function/method

2019-06-22 13:42发布

Hi I need to determine the mangled name of a function from within an c++ app itself. Is there any equivalent to the __FUNCDNAME__ macro in g++ ?

1条回答
放我归山
2楼-- · 2019-06-22 14:17

To get the demangled name use __PRETTY_FUNCTION__.

Better is to use:

#include <boost/current_function.hpp>

BOOST_CURRENT_FUNCTION

This gives the demangled name. I looked at cxxabi.h but there does not seem to be a mangle function. Do you really want the mangled name?

查看更多
登录 后发表回答