2

I was reading Ivor Horton's beginning C++20. The author calls the compiler generated default constructor as default default constructor.

Then he mentions that there are a few subtle technical reasons which make the compiler-generated version the better choice. He says this to be specific:

If there is nothing to do in a default constructor’s body (or initializer list, which we’ll encounter later), you should use = default; over {} . Not only does this make it more apparent that it concerns a default default constructor, there are also a few subtle technical reasons that make the compiler-generated version the better choice.

I tried to find the answers here, but sadly I could not figure out exactly why the default default constructor is preferred. Can anyone help please. Thank you.

baby_panda
  • 21
  • 4

0 Answers0