分享方式:


編譯器警告 (層級 1) C4441

忽略 'cc1' 的呼叫慣例;已改用 'cc2'

Managed 使用者定義型別和全域函式 泛型中的成員函式必須使用 __clrcall呼叫慣例。 編譯器使用 __clrcall

範例

下列範例會產生 C4441。

// C4441.cpp
// compile with: /clr /W1 /c
generic <class ItemType>
void __cdecl Test(ItemType item) {}   // C4441
// try the following line instead
// void Test(ItemType item) {}

ref struct MyStruct {
   void __cdecl Test(){}   // C4441
   void Test2(){}   // OK
};