-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RFC] Test clang-tidy --checks modernize-use-emplace #29937
Conversation
The code-checks are being triggered in jenkins. |
Can you elaborate ? The current code is something like
so setting |
My reading of std::vector<std::string> parName;
std::vector<double> step;
parName.push_back("angle");
step.push_back(0.1); instead of the current case where we get |
I understood the same as you - but in the present code we have std::vector<std::string> parName;
std::vector<double> step;
parName.push_back(std::string("angle"));
step.push_back(0.1); which is not an implicit constructor - so I would expect that it will be changed to |
I did a simple test, starting with #include <iostream>
#include <string>
#include <vector>
int main(void) {
std::vector<int> ints;
std::vector<std::string> strings;
ints.push_back(42);
ints.push_back(int{42});
strings.push_back("Hello world");
strings.push_back(std::string{"Hello world"});
std::cout << ints.size() << " vs " << strings.size() << std::endl;
return 0;
} Running
Running
So, using |
As a separate test, it looks like |
+1 |
See the description at https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.html .