编译器错误 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();
};