I’m trying to define the constructor that compiler generates automatically and resulted in an compilation error. Here is my code:
class myclass
{
public:
void Test_Func()
{}
};
myclass::myclass()
{
}
Is compiler doing anything in addition for a simple class like above. Here is the error that I got in MSVC compiler:
"error C2600: 'myclass::myclass' : cannot define a compiler-generated special member function (must be declared in the class first)"
The synthesised constructor is both declared and defined. You may not define it yourself.
You’ll have to declare your own constructor in order to provide an implementation.
[special](2003 wording, 12/1) says: