编译器错误 C2849

“destructor”:接口不能有析构函数

Visual C++ 接口不能有析构函数。

以下示例生成 C2849:

// C2849.cpp
// compile with: /c
__interface C {
   ~C();   // C2849 destructor not allowed in an interface
};