Rules for Member Function Binding in C++
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.
Intro OOP, Chapter 12, Slide 09