title: C++ virtual table layout of MI(multiple inheritance)
body: <p>Look at the following C++ code</p>
  
  <pre><code>class Base1 {  
  public:  
      Base1();  
      virtual ~Base1();  
      virtual void speakClearly();  
      virtual Base1 *clone() const;  
  protected:  
      float data_Base1;  
  };  
  
  class Base2 {  
  public:  
      Base2();  
      virtual ~Base2();  
      virtual void mumble();  
      virtual Base2 *clone() const;  
  protected:  
      float data_Base2;  
  };  
  
  class Derived : public Base1, public Base2 {  
  public:  
      Derived();  
      virtual ~Derived();  
      virtual Derived *clone() const;  
  protected:  
      float data_Derived;  
  }; 
  </code></pre>
  
  <p>The 《Inside of C++ Object Model 》4.2 says that the virtual table layout of class Base1,Base2 and Derived is like this:
  <img src="https://i.stack.imgur.com/rK5xx.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/TJ1k6.jpg" alt="enter image description here"></p>
  
  <p>My question is :</p>
  
  <p>The virtual table of the Base1 subObject of class Derived contains <code>Base2::mumble</code>.Why?I know Derived class shared this virtual table with Base1,so I think the function of Base2 should not appear here.Could someone tell me why? Thx.</p>