THERE IS NOT A GOOD WAY; you can do this without using a keyword friend.
In the comment you said:
, "", , " " , . , .
friend , , , . - ,, ? ? friend , -;, , - , , friend , . ++ - !
class set {
public:
class iterator
{
friend class set;
void innerMethod(){}
public:
void outerMethod(){}
};
iterator it;
void fun()
{
it.innerMethod();
it.outerMethod();
}
};
: , ,