Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Maybe more clear?

...

Related Guidelines

This rule is a partial subset of OOP58-CPP. Copy operations must mutate only the destination of the copy when copy operations do not gracefully handle self-assignment, because the copy operation may mutate both the source and destination objects (due to them being the same object).

Bibliography

[Henricson 97]Rule 5.12, Copy assignment operators should be protected from doing destructive actions if an object is assigned to itself
[ISO/IEC 14882-2014]Subclause 17.6.3.1, "Template Argument Requirements"
Subclause 17.6.4.9, "Function Arguments"
[Meyers 05]Item 11, "Handle Assignment to Self in operator="
[Meyers 14] 

...