#include <iostream>
using namespace std;
class A{};
class B{};
int main()
{
A a1;
decltype(a1) a2;
B b;
int typeHashA1 = typeid(a1).hash_code();
int typeHashA2 = typeid(a2).hash_code();
int typeHashB = typeid(b).hash_code();
cout << typeid(a1).name() << ",hash code is:" << typeHashA1 << endl;
cout << typeid(a2).name() << ",hash code is:" << typeHashA2 << endl;
cout << typeid(b).name() << ",hash code is:" << typeHashB << endl;
}
class A,hash code is:1054443428
class A,hash code is:1054443428
class B,hash code is:1104776285
输出类名
最新推荐文章于 2023-05-31 11:55:00 发布