CS202 6- ‹#›
Operator Overloading
nThe return type of overloaded operators is also defined the same as it is for overloaded functions.
nThe value returned from an overloaded operator is the residual value of the expression containing that operator and its operands.
nIt is extremely important that we pay close attention to the type and value returned.
nIt is the returned value that allows an operator to be used within a larger expression.
nIt allows the result of some operation to become the operand for another operator.
nA return type of void would render an operator useless when used within an expression. (I suggest that we never have an operator return void!)
n