There is a queue with a priority, in which QPair<int,int> lies QPair<int,int> you need to sort this queue depending on the second value of the pair. How to write a predicate? In theory, this is a functor that returns bool
struct Compare { bool operator(const int& x, const int& y) const { return x > y; } }; Just how to tell him that he should work with the second value of the pair?