In C++, is a constructor with only default arguments a default constructor?

偶尔善良 提交于 2019-11-28 10:59:37

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!