title: sort on a class member got the error unresolved overloaded function type
body: <pre><code>class S {
      public:
          vector &lt;int&gt; ia;
          int rank;
          bool cmp(S const &amp;s1, S const &amp;s2) {
              return (s1.rank &gt; s2.rank);
          }
          void sort_on_rank() {
              sort(ia.begin(), ia.end(), cmp);
          }
  };
  </code></pre>
  
  <p>This piece of code is trying to sort the vector on rank, but doesn't compile because of following error,<br>
  [Error] no matching function for call to 'sort(std::vector::iterator, std::vector::iterator, )'</p>
  
  <p>Please help me on this and tell where is the problem.</p>