参考出处:
问题描述:使用函数代码如下,
调用如下:
期望输出为:typeid.name of int = int;实际输出为:typeid.name of int = i
解决方式:将函数改为代码段的注释部分(需包含头文件#include <cxxabi.h>),详细参考链接
https://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_demangling.html
原因:可参考维基百科名字修饰词条,讲的很详细:
英文版:https://en.wikipedia.org/wiki/Name_mangling
中文版:https://zh.wikipedia.org/wiki/%E5%90%8D%E5%AD%97%E4%BF%AE%E9%A5%B0