CPB Mailing List

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: overloaded operator friends



Kregg -

I don't know this 100% for a fact, but from my readings this is what I
think is true:

The assignment operator is a special case.  The compiler creates a
default assignment operator for any object.  This function consists of
a call to the assignment operator for each object contained by the
object.

I think you can't overload it because that would be contradicting the
signature (parameters, member vs. nonmember) of the original default
assignment operator.

By the way, I think you need the return value to be ostream&. 
Otherwise, I don't think you can chain "<<" calls.

- Keith



W Komornicki's Home Page | Main Index | Thread Index