Is it true that a default constructor is synthesized for every class that does not define one?

后端 未结 6 659
感情败类
感情败类 2020-12-28 11:09

If the class doesn\'t have the constructor, will the compiler make one default constructor for it ?

Programmers new to C++ often have two common misu

6条回答
  •  天命终不由人
    2020-12-28 11:16

    Yes a default constructor is always there by default if you don't define a constructor of your own (see the default constructor section here).

提交回复
热议问题