2.6.  Friends of a Class

[ fromfile: friends.xml id: friends ]

  1. For Factory methods when you want to enforce creational rules (Section 16.1) on a class.

  2. For global operator functions such as operator<<() and operator>>() when you do not want to make the operator a member function, or do not have write-access to the class definition.