Review for a test help please :S

One of our review questions is the following:


Be able to describe how to overload an operator as a class member vs. a friend function, and when you cannot implement it as a class member.


I understand how to do this (code-wise) but not sure if I understand the principle.

My answer: You only overload a function as friend if i needs to access private members. Otherwise we make it a non friend member. Would this be a sufficient answer to the last part of this question??



no, that's incorrect.
A member function has access to the private members, there is no concept of non friend member.
Topic archived. No new replies allowed.