operator<

template<class T, class U>
    bool operator<(const pair<T, U>& x, const pair<T, U>& y);
template<class T, class U>
    bool operator<(const pair<T, U>& x, const pair<T, U>& y);

The template function returns x.first < y.first || !(y.first < x.first && x.second < y.second.

See the related sample program.