The copy assignment operator should take a const reference, not a reference, as its parameter. When you make the change, I would expect a compile error from the "rightSide.current = rightSide.head;" statement. What you should do is create current as a local variable, and then use this local variable to traverse rightSide.

I suggest ignoring aprescott_27's advice. Returning *this is correct behaviour for a copy assignment operator.

Incidentally, notice that the part where you empty the *this Polynomial is similiar to the destructor, and the part where you make a deep copy is similiar to the copy constructor. You might want to implement the copy assignment operator in terms of the copy constructor, destructor, and a member swap function. The basic idea is to copy the right hand side object to a temporary, and then swap the *this object with the temporary, and let the destructor destroy the temporary that now has the old value of the *this object. A possible implementation would be:

Code:

`Polynomial& Polynomial::Polynomial(const Polynomial& rhs)`

{

if (this != &rhs)

{

Polynomial temp(rhs);

swap(temp);

}

return *this;

}