title: Performance overhead of virtual inheritance if only one base has data members
body: <p>Virtual inheritance can come with a performance overhead when the offset to a base class needs to be calculated at runtime.</p>
  
  <pre><code>class A {...};
  class B : virtual public A {...}
  class C : virtual public A {...}
  class D : virtual public B, virtual public C {...}
  </code></pre>
  
  <p>Will any offset be calculated at runtime if in the above hierarchy the only class that has data members is "A" and none of the classes have virtual functions. (so the offset to any base class should be zero.)</p>
  
  <p>(I'm trying to design a hierarchy of container classes where "A" has the data pool and all meta-data needed and has a minimal functionality. "B" and "C" extend that functionality and "D" has all the functionality. It's important that I can cast from a reference to D to a reference to B or C or A. Since the elements in the containers will be accessed frequently it should have best possible performance. I'm trying to find a better design but if there is no overhead in this case then my problem would be solved.)</p>