> [I gather that the C++ standards committee came very close to defining> the structure of a vtbl, so portable code could mess with them. I> suspect you'll find that no matter which compiler you use, the vtbls are> all about the same. -John]

No, the C++ standards committee deliberately avoided defining the
structure of a vtbl. For example, failure to define a virtual
function that cannot ever be called is an error but no diagnostic is
required because there are ways to implement virtual functions without
using vtables.

Code that messes with vtables is only portable within the object model,
i.e. between two compilers that can generate object code that can be linked
together. Assuming, of course, that vtables exist at all in that
implementation.

It is about as portable as code that takes the address of a stack-based
variable and tries to manipulate the stack frame.

-- Bill Gibbons
[Yes, I said they didn't define the vtbl. Evidently whoever told me
they considered doing so lied to me. -John]