Switch to copy-and-swap idiom for operator=.
This allows the compiler to elide a copy when rhs is a temporary.