Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There's a copy constructor, but no '=' operator implemented. This is dangerous.
- Loading branch information
There's a copy constructor, but no '=' operator implemented. This is dangerous.
c085447
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a good idea to check for self-assignment -- to make sure (&rhs != this) -- before modifying anything.
It might be fine here, depending on how memcpy works on various systems when passed the same pointer for first and second arguments.
See:
https://isocpp.org/wiki/faq/assignment-operators
c085447
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 on this one.
c085447
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍