-Wrange-loop-construct in for (const std::pair<std::string,...)
linhaigoo opened this issue · comments
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.