Compiler that does not allow to determine the constructor generated by the compiler

I am trying to determine the constructor that the compiler automatically generates and results in a compilation error. Here is my code:

class myclass
 {
   public:
       void Test_Func()
       {}
 };
myclass::myclass()
{
}

The compiler does something extra for a simple class, as described above. Here is the error I received in the MSVC compiler:

"error C2600: 'myclass::myclass' : cannot define a compiler-generated special member function (must be declared in the class first)"
+3
source share
4 answers

A synthesized constructor is declared and defined. You cannot define it yourself.

You need to declare your own constructor in order to provide an implementation.

[special] (2003 wording, 12/1) reads:

(12.1), (12.8) (12.4) -. - , , 12.1. , , 12.1, 12.4 12,8. .

+8

, . , . , , .

+3

:

class myclass { public: myclass(); void Test_Func() {} }; myclass::myclass() { }
0

If you intend to define a function, you must include it in the class declaration, for example:

class myclass { public: myclass(); void Test_Func() {} }; myclass::myclass() { }
0
source

All Articles