Is it possible to somehow provide access to protected class variables, child classes of a friend class?
Well, here is such an incident:
class foo { friend class bar; int i; public: void hello() { i = 0;/*OK*/ }; }; class bar { public: void hello(foo *f) { f->i = 0;/*OK*/ }; }; class baz : public bar { public: void hello(foo *f) { f->i = 0;/*ERROR*/ }; }
Please, tell me how to solve this problem.
PS This kind of child classes will be about twenty