по спецификатору защищенного доступа.

ример кода, который меня раздражает:

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->b->foo(); /* Compilator sets an error: 'virtual void Base::foo() is protected' */
    }
};

Как вы получаете доступ к защищенной переопределенной функции?

Спасибо за вашу помощь. : О)

Ответы на вопрос(6)

Ваш ответ на вопрос