10.5 Protected Member Access

Class members declared as protected can be used only by the following:

Member functions of the class that originally declared these members.

Friends of the class that originally declared these members.

Classes publicly derived from the class that originally declared these members.

Protected members are not as private as private members, which are accessible only to members of the class in which they are declared, but they are not as public as public members, which are accessible in any function.

Protected members that are also declared as static are accessible to any friend or member function of a derived class. Protected members that are not declared as static are accessible to friends and member functions in a derived class only through a pointer to, reference to, or object of the derived class.