title: Sort a vector c++
body: <p>I am trying to sort a 2D vector with the type:</p>
  
  <pre><code>vector&lt;pair&lt;char, double&gt;&gt; output;
  </code></pre>
  
  <p>I am trying to arrange them from the highest to lowest double value and only displaying the top 5. This is what I am trying to do:</p>
  
  <pre><code>sort(output.begin(), output.end());
  </code></pre>
  
  <p>But this sort is not working properly for me. What am I doing wrong?</p>