mardi 26 juillet 2016

Adapt std::pair for STL algorithm lambda

Suppose I have STL container with std::pair. Is there any way to adapt pair's second for STL algorithm lambda using boost?

std::vector<std::pair<int, SomeStruct> vec;
const auto Predicate = [](SomeStruct const& s) { ... }
auto it = std::find_if(vec.begin(), vec.end(), boost-magic(Predicate));

Aucun commentaire:

Enregistrer un commentaire