"Phui Hock" <bu****@gmail.com> wrote in message
news:ch********@odak26.prod.google.com...
"When you make a virtual function call through a base-class pointer
(that is, when you make a polymorphic call), the compiler quietly
inserts code to fetch the VPTR and look up the function address in the
VTABLE..."
Can anyone tell me how the VPTR of the derived class is fetched? Where
can I get more information bout this?
The book John cited does indeed give useful insight into
the design of C++.
But note that the actual mechanics of e.g. polymorphism is
completely implementation-specific. Each might implement it
in its own way. The only language requirement is that a
particular *behavior* is the result. The language does not
define things such as 'v-tables' or 'v-pointers'.
-Mike