Hi, all:
I am troubled by the following problem. Suppose I have two classes X, Y both have a private part. Then X::f and Y::g are two member functions of X and Y respectively. I want X::f to have access to Y's private and Y::g have access to X's by granting friendship. However it seems this is not allowed.
For example, if I want X::f be a friend to Y, I must define (not only declare) X before Y, so that Y knows f is a part of X, vice versa, I need Y to be defined before X to make Y::g a friend of X. But these two contradict each other.