编译器错误 C2550

“identifier”:构造函数初始值设定项列表只能在构造函数定义中使用

基类初始值设定项列表可在非构造函数的函数的定义中使用。

以下示例生成 C2550:

// C2550.cpp
// compile with: /c
class C {
public:
   C();
};

class D : public C {
public:
   D();
   void func();
};

void D::func() : C() {}  // C2550
D::D() : C() {}   // OK