Kompilatorfel C3185

"typeid" används på en hanterad eller WinRT-typ "type", använd "operator" istället

Anmärkningar

Du kan inte tillämpa typeid-operatorn på en hanterad eller WinRT-typ. använd typeid i stället.

Example

Följande exempel genererar C3185 och visar hur du åtgärdar det:

// C3185a.cpp
// compile with: /clr
ref class Base {};
ref class Derived : public Base {};

int main() {
   Derived ^ pd = gcnew Derived;
   Base ^pb = pd;
   const type_info & t1 = typeid(pb);   // C3185
   System::Type ^ MyType = Base::typeid;   // OK
}