C ++ typeid operator

I am using Visual Studio 2005 Proffesional Edition.

In the following example, SomeClass is a class that is defined in the third-party DLL that I use. SomeClass has virtual methods. I noticed that the typeid operator gives different results when applied to the type itself and when applied to the type object. Is this normal behavior, and if it cannot be the reason for this behavior?

typeid(SomeClass).raw_name()   // the value of this is   ".?AVSomeClass@@"
typeid(SomeClass).name()          ///  "class SomeClass"

SomeClass obj;
typeid(obj).raw_name(); // ".?AVTLomeClass@@"
typeid(obj).name();       // "class TLomeClass"
+5
source share
2 answers

Is the code in your question the same or similar to the code that is having problems?

typeid, , type_info, . , , typeid Base & ( Base ), Derived ( Derived Base > ), type_info, typeid, Derived, Base. , - ?

, (, MS Visual Studio) typeid, , (RTTI). , RTTI , .

P.S. , , typeid - ++. .

+2

- MSDN. , , , , .DLL.

++ , , . , , , , , . , , VS2008 , , VS2003. (, , GCC, ICC .)

+1

All Articles