Consider the following class hierarchy:
- base class Object with a virtual method foo()
- an arbitrary hierarchy with multiple inheritance (virtual and non-virtual); each class is a subtype of Object; some of them override foo(), some don't
- a class X from this hierarchy, not overriding foo()
How to determine which method will be executed upon a call of foo() on an object of class X in C++?
(I'm looking for the algorithm, not any specific case.)