共用方式為


編譯器錯誤 C2524

'destructor' :解構函式/完成項必須有 'void' 參數列表

備註

解構函式或完成項具有非 void 的參數清單。 不允許其他參數類型。

範例

下列程式代碼會重現 C2524。

// C2524.cpp
// compile with: /c
class A {
   A() {}
   ~A(int i) {}    // C2524
   // try the following line instead
   // ~A() {}
};

下列程式代碼會重現 C2524。

// C2524_b.cpp
// compile with: /clr /c
ref struct I1 {
protected:
   !I1(int i);   // C2524
   // try the following line instead
   // !I1();
};