共用方式為


編譯器錯誤 C3283

'type': 介面不能有執行個體建構函式

CLR 介面 不能有執行個體建構函式。 允許靜態建構函式。

下列範例會產生 C3283:

// C3283.cpp
// compile with: /clr
interface class I {
   I();   // C3283
};

可能的解決方式:

// C3283b.cpp
// compile with: /clr /c
interface class I {
   static I(){}
};