Is there a difference between declaring a friend function/class as private or public? I can't seem to find anything about this online.
I mean the difference between:
class A
{
public:
friend class B;
};
and
class A
{
private: //or nothing as the default is private
friend class B;
};
Is there a difference?
friend
class to access the members declaredprivate
in the class that made the declaration. In the case of this example, an instance of class B can access the private members of class A – Sash