|
|
От: |
Greg Zubankov
|
|
| Дата: | 17.10.06 10:36 | ||
| Оценка: | 16 (3) | ||
When a friend or a member function of a derived class references a protected nonstatic member function or protected nonstatic data member of a base class, an access check applies in addition to those described earlier in clause 11. Except when forming a pointer to member (5.3.1), the access must be through a pointer to, reference to, or object of the derived class itself (or any class derived from that class) (5.2.5). If the access is to form a pointer to member, the nested-name-specifier shall name the derived class (or any class derived from that class).
void funcB()
{
B::funcA(); // ok
A::funcA(); // ok
&B::funcA; // error
};