Introduction to OOP: Chapter 12: Implications of Inheritance
Rules for Member Function Binding
The rules for deciding what member function to execute are complicated
because of the slicing problem.
- With variables that are declared normally, the binding of member function
name to function body is based on the static type of the argument
(regardless whether the function is declared virtual or not).
- With variables that are declared as references or pointers, the
binding of the member function name to function body is based on
the dynamic type if the function is declared as virtual, and the static
type if not.