How can I make std::find_if and std::map work together using some boost library?
问题 This question is inspired from another topic which poses this question: Find the first value greater than user specified value from a map container which can be solved in several ways. A typical C++03 solution defines a dedicated function (or functor) and pass it to std::find_if as third argument. In C++11, one can avoid defining a dedicated function (or functor), and can instead make use of lambda as: auto it = std:: find_if(m.begin(), mp.end(), [n](const std::pair<std::string, int> & x) ->