title: C++ Virtual Const Function
body: <p>Given the following snippet, </p>
  
  <pre><code>class Base
  {
  public:
      virtual void eval() const
      {
          std::cout&lt;&lt;"Base Const Eval\n";
      }
  };
  
  class Derived:public Base
  {
  public:
      void eval()
      {
          std::cout&lt;&lt;"Derived Non-Const Eval\n";
      }
  };
  
  int main()
  {
  
      Derived d;
      Base* pB=&amp;d;
  
      pB-&gt;eval(); //This will call the Base eval()
  
      return 0;
  }
  </code></pre>
  
  <p>Why the pB->eval() will call the Base::eval()?</p>
  
  <p>Thank you</p>