Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 7
    You can add C++ to the list of languages that have this behaviour. Commented Aug 3, 2012 at 9:11
  • 18
    And in C++ you can now say Foo() = default; to get the default one back. Commented Aug 3, 2012 at 9:35
  • 1
    If your constructor with parameters can have default arguments for all its parameters, then it would conflict with the built-in parameterless constructor, hence the need to delete it when you create your own. Commented Aug 3, 2012 at 14:13
  • 3
    Imagine being present for this debate between the founders of the first compiler to make the default constructor requirement and the heated discussion it would have inspired. Commented Aug 7, 2012 at 17:48
  • 7
    @HenkHolterman C++ isn't just another with this behaviour, but the originator, and it's to allow C compatibility, as discussed by Stroustrup in The Design and Evolution of C++ and as summarised in my updated answer. Commented Aug 9, 2012 at 12:58