We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
To prevent accidental copy of large objects: e.g.
void Phagocytize(std::vector<T>&& v);
rather than
void Phagocytize(std::vector<T> v);
so that
Phagocitize(some_vector);
is illegal.
The text was updated successfully, but these errors were encountered:
More specifically, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rf-consume.
We don't need to do this for move-only objects. Importantly, we must take care that a parameter like that actually gets moved:
Flag all X&& parameters (where X is not a template type parameter name) where the function body uses them without std::move.
X&&
X
std::move
Sorry, something went wrong.
eggrobin
No branches or pull requests
To prevent accidental copy of large objects:
e.g.
rather than
so that
Phagocitize(some_vector);
is illegal.
The text was updated successfully, but these errors were encountered: