Share via


編譯器錯誤 C2574

'destructor' : 不可以宣告為 static

建構函式和解構函式兩者都不能宣告為 static。

下列範例會產生 C2574:

// C2574.cpp
// compile with: /c
class A {
   virtual static ~A();   // C2574
   //  try the following line instead
   // virtual ~A();
};