Home Segments Index Top Previous Next

184: Sidetrip

You must include a definition for a default constructor function in a class definition under the following condition: You define a constructor function with parameters, and you write declarations, such as tank_car t;, that do not include an argument list.

The rationale is that, if you have not defined a default constructor, then the lack of an argument list suggests that you have forgotten to include arguments for the parameter-bearing constructor that you have defined.