Friday, December 3, 2010

Class Size

class VFVABC : public virtual VFA, virtual VFB {virtual int f() {return 1;}}; is 8 bytes on Solaris.

There are two vptrs in VFABC. One to handle the virtual inheritance to VFA and one to handle the virtual inheritance to VFB. An extra vptr for the virtual functions declared in VFABC is not

needed, because the other vptrs can be used for this function.

No comments:

Post a Comment