In C++, is a constructor with only default arguments a default constructor?
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 . 来源: https://stackoverflow.com/questions/11250690/in-c-is-a-constructor-with-only-default-arguments-a-default-constructor