- What is the effect of declaring a function friend?
A non-member friend function has the same access to the members of the class as a member function.
- What is the difference between granting friendship to a function and a function template?
Granting friendship to a template makes every instantiation of this template a friend; this includes instantiations of the same template but with different, unrelated, types.
- Why are binary operators usually implemented as non-member functions?
Binary operators implemented as member functions are always called on the left-hand-side operand of the operator, with no conversions allowed for that object. Conversions are allowed for the right-hand-side operand, according to the type of the argument of the member operator. This creates an asymmetry between expressions such as x+2 and 2+x, where the latter cannot be handled by a member...