Like any other function, a virtual function can have default arguments. As usual, the value, if any, of a
default argument used in a given call is determined at compile time. If a call omits an argument that has
a default value, then the value that is used is the one defined by the type through which the function is
called, irrespective of the object's dynamic type. When a virtual is called through a reference or pointer
to base, then the default argument is the value specified in the declaration of the virtual in the base
class. If a virtual is called through a pointer or reference to derived, the default argument is the one
declared in the version in the derived class.
Using different default arguments in the base and derived versions of the same virtual is almost
guaranteed to cause trouble. Problems are likely to arise when the virtual is called through a reference
or pointer to base, but the version that is executed is the one defined by the derived. In such cases, the
default argument defined for the base version of the virtual will be passed to the derived version, which
was defined using a different default argument.