Hello,
struct S{
friend class B;
private:
int i;
};
class B{
B(){}
virtual ~B(){}
};
class D : public B{
};
it turns out that although for D, its parent class B is a friend of S, D is
not a friend to S, therefore
it is allowed to manipulate private member i of S within D. Should i declare
friend class all one by one in S
or is there a succinct way of expressing that all the inherited class of B
should be friend of S?
br,Kai