The compiler will not define an implicit default constructor (and not just "declare", the definition is the key here) for a derived class if there is no default constructor for the base class. (Any constructor that can be called without arguments is the default constructor, regardless of the actual signature, if default arguments are provided).
So, we can summarize the requirements for any class to have a well-formed implicitly defined constructor:
- There are no constant elements.
- No reference elements.
- All base classes must have accessible default constructors.
- All non-static members must have accessible default constructors.
Kerrek SB
source share