I am trying to understand how default constructor (provided by the compiler if you do not write one) versus your own default constructor works.
So for example I wrot
A n();
declares a function, named n
, that takes no arguments and returns an A
.
Since it is a declaration, no code is invoked/executed (especially no constructor).
After that declaration, you might write something like
A myA = n();
This would compile. But it would not link! Because there is no definition of the function n
.