title: std::sort() on a vector of Class pointers
body: <p>I have a vector of class pointers <code>std::vector&lt;Square*&gt; listSquares</code>. I want to sort it with one of the attributes of the class as the key. This is what I'm doing</p>
  
  <pre><code>bool compById(Square* a, Square* b)
  {
      return a-&gt;getId() &lt; b-&gt;getId();
  }
  
  std::sort(listSquares.begin(), listSquares.end(), compById)
  </code></pre>
  
  <p>but the compiler says:
  error: no matching function for call to 'sort(std::vector::iterator, std::vector::iterator, &lt;unresolved overloaded function type&gt;)'</p>
  
  <p>what am I doing wrong here?</p>