Thursday, June 14, 2007

Implementing operator as member or nonmember functions

The answer to implementing an operator as a member or a non member lies in the following simple points
  • if any operand of an operator is susceptible to implicit type conversion , implement it as a member function
  • if the result of an operation does not effect the two operands or an operand implement it as a non-member function.

No comments: