共用方式為


編譯器錯誤 C3189

'typeid<type abstract declarator>': 不再支持此語法,請改用 ::typeid

已使用過時的 typeid 形式,請使用新的表單。

在 Visual Studio 2022 和更新版本中,此錯誤已經過時。

下列範例會產生 C3189:

// C3189.cpp
// compile with: /clr
int main() {
   System::Type^ t  = typeid<System::Object>;   // C3189
   System::Type^ t2  = System::Object::typeid;   // OK
}