title: std::sort and compare-function with template does not work
body: <p>I want to sort a vector of arbitrary types, so I wrote the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  using namespace std;
  
  template&lt;class T&gt;
  bool compare(T a, T b) {
      return a &lt; b;
  }
  
  int main() {
      vector&lt;int&gt; v;
      v.push_back(3);
      v.push_back(4);
      v.push_back(2);
      v.push_back(1);
  
      sort(v.begin(), v.end(), compare);
  
      for (size_t i = 0; i &lt; v.size(); i++) {
          cout &lt;&lt; v.at(i) &lt;&lt; " ";
      }
  
      return 0;
  }
  </code></pre>
  
  <p>This code is not compiling, with a error message like:</p>
  
  <pre><code>..\src\Test.cpp:22:34: error: no matching function for call to 'sort(std::vector&lt;int&gt;::iterator, std::vector&lt;int&gt;::iterator, &lt;unresolved overloaded function type&gt;)'
  ..\src\Test.cpp:22:34: note: candidates are:
  
  ... and more
  </code></pre>
  
  <p>When I implement the compare-function with concrete types, it works.
  Can someone tell me how to do that with a template-compare-function?</p>