简体   繁体   English

C ++获取函数/方法的错位名称

[英]C++ get the mangled names of a function/method

Hi I need to determine the mangled name of a function from within an c++ app itself. 嗨,我需要从c ++应用程序本身确定一个函数的错位名称。 Is there any equivalent to the __FUNCDNAME__ macro in g++ ? 是否有与g ++中的__FUNCDNAME__宏相同的__FUNCDNAME__

To get the demangled name use __PRETTY_FUNCTION__. 要获取demangled名称,请使用__PRETTY_FUNCTION__。

Better is to use: 更好的是使用:

#include <boost/current_function.hpp>

BOOST_CURRENT_FUNCTION

This gives the demangled name. 这给出了demangled名称。 I looked at cxxabi.h but there does not seem to be a mangle function. 我查看了cxxabi.h,但似乎没有一个mangle函数。 Do you really want the mangled name? 你真的想要受损的名字吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM