mardi 28 juillet 2015

Why shouldn't the inherited constructor inherit the default arguments?

C++ Primer (5th edition) on page 629 states:

  • If a base class constructor has default arguments, those arguments are not inherited. Instead, the derived class gets multiple inherited constructors in which each parameter with a default argument is successively omitted.

What is the reasoning behind this rule?

Aucun commentaire:

Enregistrer un commentaire