CS202 6- ‹#›
Overloading = Operators
nWhenever there is dynamic memory allocated on an object-by-object basis in a class, we should overload the assignment operator for the same reasons that require the copy constructor
nThe assignment operator must be overloaded as a member, and it doesn’t modify the second operand (so if it is an object of a class -- it should be a const ref.)
nThe assignment operator can be chained, so it should return an lvalued object, by reference
nIt modifies the current object, so it cannot be a const member function