[lug] (OT) C++ ?, pointers to member functions

D. Stimits stimits at idcomm.com
Wed Aug 8 15:31:00 MDT 2001


Tom Tromey wrote:
> 
> >>>>> "Scott" == Scott A Herod <herod at interact-tv.com> writes:
> 
> Scott>   Of course my copy of Stroustrup is at home.  I'll look tonight.
> Scott> Is the format of the vtable specified in the C++ standard?
> 
> Nope.
> 
> Most compilers have their own vtable layout.  g++ even changed its
> vtable layout between 2.95 and 3.0 -- and neither of these is the same
> as the MSVC++ layout.
> 
> Tom
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

I would expect that regardless of how vtables are layed out, if an
object uses virtual functions like f(), then you should be able to refer
to the function with a relative offset anyway. The actual vtable layout
shouldn't matter, unless the compiler somehow has an added "suckiness
factor" (this is a highly technical term, you'll only find it in the
most sophisticated manuals).

D. Stimits, stimits at idcomm.com



More information about the LUG mailing list