Why is there a top_offset in VTT implemented by gcc?
问题 Here is a detailed description of VTT in the top-voted answer.But the answer does not explain why is there a top-offset in the VTT. From my point of view,when we down_cast a base pointer to derived pointer, the compiler already knows the offset needed to be adjusted in compile time (when there is no virtual derivation) ,so there is no need to store a top_offset in situation below: class A { public: int a; }; class B { public: int b; virtual void w(); }; class C : public A, public B { public: