Изо всех сил стараюсь ответить generic :
template <typename K>
struct match_first
{
const K _k; match_first(const K& k) : _k(k) {}
template <typename V>
bool operator()(const std::pair<K, V>& el) const
{
return _k == el.first;
}
};
используйте его, например,
it = std::find_if(vec.begin(), vec.begin(), match_first<int>(1));
if (it!=vec.end())
{
// found
}