title: error: no matching function for call to 'sort(..., ..., <unresolved overloaded function type>)'
body: <p>I declare and then define a function that performs a comparison:</p>
  
  <pre><code>  template &lt;class KEY, class VALUE&gt;      
    bool compareFlatMapElements(
                typename SortedPairsVector&lt;KEY, VALUE&gt;::ElementType&amp; first, 
                typename SortedPairsVector&lt;KEY, VALUE&gt;::ElementType&amp; second);
          // Compares the specified 'first' and 'second' using
          // 'bsl::less&lt;KEY&gt;' to compare the values stored in 'first()' of
          // each pair held by the 'FlatMap_Element.
  
    template &lt;class KEY, class VALUE&gt;
    inline
    bool compareFlatMapElements(
                typename SortedPairsVector&lt;KEY, VALUE&gt;::ElementType&amp; first, 
                typename SortedPairsVector&lt;KEY, VALUE&gt;::ElementType&amp; second)
    {
        return first.data().first &lt; second.data().first;
    }
  </code></pre>
  
  <p>I then later try to use it in a sort</p>
  
  <pre><code>      std::sort(d_data.begin(), d_data.end(), compareFlatMapElements);
  </code></pre>
  
  <p>What is causing the following error and how do I fix it?</p>
  
  <pre><code>error: no matching function for call to 'sort(..., ..., &lt;unresolved overloaded function type&gt;)'
  </code></pre>