use this,
template
struct sortFunctor: public unary_function, std::pair>
{
bool operator()(const std::pair& First, const std::pair& Second)
{
if(First.first < Second.first)
{
return false;
}
if(First.first == Second.first && First.second < Second.second)
{
return false;
}
return true;
}
}
then pass this functor as a third parameter to sort function.