This approach may be used in friendly function when a function needs to access private data in objects from two different classes. This may be accomplished in two similar ways:
Holzner, Steven (2001). C++ : Black Book. Scottsdale, Ariz.: Coriolis Group. p. 397. ISBN 1-57610-777-9. When you declare a function a friend of a class, that function has access to the internal data members of that object (that is, its protected, and private data members.) 1-57610-777-9 ↩