Skip to content
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

-Wrange-loop-construct in for (const std::pair<std::string,...) #828

Open
linhaigoo opened this issue Dec 7, 2022 · 0 comments
Open

-Wrange-loop-construct in for (const std::pair<std::string,...) #828

linhaigoo opened this issue Dec 7, 2022 · 0 comments

Comments

@linhaigoo
Copy link

I'm using the latest code 8489989 and enable all gcc warnings and it reports -Wrange-loop-construct warnings in sentence " for (const std::pair<std::string,...: map container) " such as " for (const std::pair<std::string, base::type::LoggerRegistrationCallbackPtr>& h".

It found that the "const std::pairstd::string,...& h" may not avoid construct objects because "std::string" in std::pair should be "const std::string". It's better to directly use "const auto &" for elimenating confusing of type matching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant