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
#include <string> #include <vector> struct S { std::string s; }; void f(std::string a) { std::vector<S> v; v.push_back({std::move(a)}); // no warning }
https://godbolt.org/z/4jrj1M6hY With C++20, v.emplace_back(std::move(a)); should be used.
v.emplace_back(std::move(a));
The text was updated successfully, but these errors were encountered:
@llvm/issue-subscribers-c-20
Author: None (chrchr-github)
struct S { std::string s; };
void f(std::string a) { std::vector<S> v; v.push_back({std::move(a)}); // no warning }
https://godbolt.org/z/4jrj1M6hY With C++20, `v.emplace_back(std::move(a));` should be used. </details>
Sorry, something went wrong.
github-actions
No branches or pull requests
https://godbolt.org/z/4jrj1M6hY
With C++20,
v.emplace_back(std::move(a));
should be used.The text was updated successfully, but these errors were encountered: