C ++获取函数/方法的标记名称 [英] C++ get the mangled names of a function/method

查看:193
本文介绍了C ++获取函数/方法的标记名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我需要从一个c ++应用程序本身确定一个函数的名称。
在g ++中是否有等价的 __ FUNCDNAME __ 宏?

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++ ?

推荐答案

要获取解析名称,请使用__PRETTY_FUNCTION__。

To get the demangled name use __PRETTY_FUNCTION__.

更好的是使用:

#include <boost/current_function.hpp>

BOOST_CURRENT_FUNCTION

这给出了解析的名称。我看着cxxabi.h,但似乎没有一个mangle函数。你真的想要改名吗?

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?

这篇关于C ++获取函数/方法的标记名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆