Operator Overloading  «Prev 

Passing arguments through the argument list

All friend functions pass all their arguments through the argument list, and each argument value is subject to assignment-compatible conversions. Here is an example:

class  pandaBear {
...
pandaBear (int);
   int memberFunction();
   friend int nonMemberFunction(const pandaBear&);
}

class  designPattern {
...
designPattern (int);
   int memberFunction();
   friend int nonMemberFunction(const designPattern&);
}

When a member function is invoked, no user-defined conversions are applied.
On the other hand, this conversion will be applied to the argument of friendFunction() in the following call:

nonMemberFunction (5);

Therefore if an implicit function argument type conversion is desired in an operation, the function implementing this operation must be a nonmember function.