Have assignment operators return a reference to *this

This is only a convention; code that doesn't follow it will compile. However, the convention is followed by all the built-in types as well as by all the types in  the standard library (e.g., string, vector, complex, tr1::shared_ptr, etc.). Unless you have a good reason for doing things differently, don't.

你可能感兴趣的:(Have assignment operators return a reference to *this)