title: single virtual inheritance compiler optimization in c++?
body: <p>If I have this situation in C++ project: </p>
  
  <ul>
  <li>1 base class 'Base' containing only pure virtual functions</li>
  <li>1 class 'Derived', which is the only class which inherits (public) from 'Base'</li>
  </ul>
  
  <p>Will the compiler generate a VTABLE?</p>
  
  <p>It seems there would be no need because the project only contains 1 class to which a Base* pointer could possibly point (Derived), so this could be resolved compile time for all cases.</p>
  
  <p>This is interesting if you want to do dependency injection for unit testing but don't want to incur the VTABLE lookup costs in production code.</p>