In the following code:
struct Foo
{
Foo(int x=0);
};
Does the constructor count as a default constructor?
C++98 §12.1/5 (emphasis mine):
A default constructor for a class X is a constructor of X that can be called without an argument. If there is no user-declared constructor for class X, a default constructor is implicitly declared.
So yes, it does count as a default constructor. See also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With