title: Is final used for optimization in C++?
body: <pre><code>class A {
  public:
      virtual void f() = 0;
  };
  
  class B : public A {
  public:
      void f() final override { };
  };
  
  int main() {
      B* b = new B();
      b-&gt;f();
  }
  </code></pre>
  
  <p>In this case, is the compiler required to still do the v-table lookup for <code>b-&gt;f();</code>, or can it call <code>B::f()</code> directly because it was marked <code>final</code>?</p>