title: How do you keep a priority queue of pairs that's ordered by the second element?
body: <p>Suppose we have a priority queue such as:</p>
  
  <pre><code>priority_queue&lt;pair&lt;int, int&gt; &gt; pQ;
  </code></pre>
  
  <p>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?</p>