Friend classes in C++ give us access to non-member functions or other classes. In this article Kais shows us exactly how and why we should use friend classes and functions.
C++ Tricks of the Trade: Friend Functions (Page 1 of 5 )
This new "C++ Tricks of the Trade" series of articles will show you how to write efficient yet maintainable C++ code, as well as explaining how to avoid common programming pitfalls.
In this introductory article, Kais discusses how to use friend functions to enhance a class interface.