Export (0) Print
Expand All
Expand Minimize

Compiler Error C2351

obsolete C++ constructor initialization syntax

In a new-style initialization list for a constructor, you must explicitly name each direct base class, even if it is the only base class.

The following sample generates C2351:

// C2351.cpp
// compile with: /c
class B {
public: 
   B() : () {}   // C2351
   B() {}   // OK
};

Community Additions

ADD
Show:
© 2014 Microsoft