-
Notifications
You must be signed in to change notification settings - Fork 981
Prevent accidental copies of expensive-to-copy object types #20226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent accidental copies of expensive-to-copy object types #20226
Conversation
|
/ok to test c72f8ea |
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.
Seems fine to me. How did you decide which of the move constructors to make noexcept? Should we be more aggressive in making more of those move constructors noexcept?
Defaulted move constructor don't need the keyword, since the |
|
/merge |
Description
Deleted copy constructor of classes that are expensive to copy. Some of these classes have const data members, so they previously had the move constructors implicitly deleted, making accidental copies even more likely.
Also made the non-default move constructors
noexceptto avoid implicit copies in container likestd::vector.Checklist