7.0 Classes
The assignment operator should return a reference to the affected object. Returning void causes problems on with some compilers.
7.15.2 Guard against assigning to *this (R)
Always check against assignment to the same object. This will prevent bugs in objects that perform heap allocation in constructors.
Example: if (this == &other) return;
7.15.3 Do not make the assignment operator virtual (R)
This is almost always a mistake. Derived classes will have a different type signature (by definition).
Generated with CERN WebMaker