For example:
int a = 12;
cout << typeof(a) << endl;
Expected output:
int
Note that the names generated by the RTTI feature of C++ is not portable. For example, the class
MyNamespace::CMyContainer
will have the following names:
// MSVC 2003:
class MyNamespace::CMyContainer[int,class test_MyNamespace::CMyObject]
// G++ 4.2:
N8MyNamespace8CMyContainerIiN13test_MyNamespace9CMyObjectEEE
So you can't use this information for serialization. But still, the typeid(a).name() property can still be used for log/debug purposes