Answers for "how to find the first element of vector of pair in c++"

C++
3

find in set of pairs using first value cpp

auto it = std::find_if(st.begin(), st.end(), [](const pair<int,int>& p ){ return p.first == 1; });
Posted by: Guest on July-03-2020
0

find an element in vector of pair c++

auto index = std::distance(dict.begin(), std::find_if(dict.begin(), dict.end(), [&](const auto& pair) { return pair.first == movieName; }));
Posted by: Guest on September-20-2021

Code answers related to "how to find the first element of vector of pair in c++"

Browse Popular Code Answers by Language