Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wordsmithing

...

This compliant solution guards against self-assignment by testing whether the given parameter is the same as this. If self-assignment occurs, the result of then operator= is a noop does nothing; otherwise, the copy proceeds as in the original example.

...