Suppose we have a priority queue such as:
priority_queue<pair<int, int> > pQ; and we want pQ to be ordered so that the pair with the smallest second element is always first. Is there a simple way to accomplish this using C++11? It would be ideal if I had an elegant solution such as one that uses lambda functions. Is this possible?