Compiler Error C2533

'identifier' : constructors not allowed a return type

A constructor cannot have a return type (not even a void return type).

The following sample generates C2533:

// C2533.cpp
// compile with: /c
class X {
public:
   X();   
};

int X::X() {}   // C2533
X::X() {}   // OK

Community Additions

ADD
Show: