abumq / easyloggingpp

C++ logging library. It is powerful, supports asynchronous low latency, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

-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.