title: How to access protected method in base class from derived class?
body: <p>Here is a sample of code that annoys me:</p>
  
  <pre><code>class Base {
    protected:
      virtual void foo() = 0;
  };
  
  class Derived : public Base {
    private:
      Base *b; /* Initialized by constructor, not shown here
                  Intended to store a pointer on an instance of any derived class of Base */
  
    protected:
      virtual void foo() { /* Some implementation */ };
      virtual void foo2() {
        this-&gt;b-&gt;foo(); /* Compilator sets an error: 'virtual void Base::foo() is protected' */
      }
  };
  </code></pre>
  
  <p>How do you access to the protected overrided function?</p>
  
  <p>Thanks for your help. :o)</p>