Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我需要从 c++ 应用程序本身中确定函数的错位名称。是否有任何等效__FUNCDNAME__于 g++ 中的宏?
__FUNCDNAME__
使用 __PRETTY_FUNCTION__ 来获得解构后的名称。
更好的是使用:
#include <boost/current_function.hpp> BOOST_CURRENT_FUNCTION
这给出了 demangled 的名称。我查看了 cxxabi.h 但似乎没有 mangle 功能。你真的想要这个乱七八糟的名字吗?