Lecture 4 - Slide 33 : 40
Friends - Example 1

A function needs access to private variables in two classes

friends-sit6.cc
A function f get access to the private state of both class A and B.

Matrix Vector multiplication is a compelling, practical example of this approach, see §19.4 in The C++ Prog. Lang. (4. edition)