previous | start | next

Overloading Operators as Non-member Functions

We can still make this work by providing one more function to overload operator+.

But it can't be a member function of the Pair class, since the left operand is an ordinary integer, not a Pair.

A non-member operator+ function can/must be called without using the "." member selection.

But this operator will still need 2 operands - the integer and the Pair.



previous | start | next