编译器错误 C2846

“constructor”:接口不能有构造函数

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

以下示例生成 C2846:

// C2846.cpp
// compile with: /c
__interface C {
   C();   // C2846 constructor not allowed in an interface
};