typeid().name() 中显示的整数是什么意思?
What does the integer shown in typeid().name() mean?
typeid().name()
输出中显示的整数是什么意思?例如:
#include<iostream>
#include<typeinfo>
class implementer{
public :
void forNameSake()
{
}
};
int main()
{
implementer imp2;
std::cout<<typeid(imp2).name();
}
给出输出:
11implementer
输出中的11
是什么意思?
What does the 11 in the output mean?
在这种特殊情况下,很可能表示后面的标识符的长度。 implementer
是 11 个字符。
您可能对 https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.name 感兴趣,特别是 <source-name> ::= <positive length number> <identifier>
部分。
typeid().name()
输出中显示的整数是什么意思?例如:
#include<iostream>
#include<typeinfo>
class implementer{
public :
void forNameSake()
{
}
};
int main()
{
implementer imp2;
std::cout<<typeid(imp2).name();
}
给出输出:
11implementer
输出中的11
是什么意思?
What does the 11 in the output mean?
在这种特殊情况下,很可能表示后面的标识符的长度。 implementer
是 11 个字符。
您可能对 https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.name 感兴趣,特别是 <source-name> ::= <positive length number> <identifier>
部分。