title: C++ implicit/explicit template method specialization issue
body: <p>I have a problem with calling a function:</p>
  
  <pre><code>namespace Sort {
  
      enum Type {
          insertion, selection, merge
      };
  
      template &lt;class Elem = int, class Container = std::vector&lt;Elem&gt;&gt;
      void sort(std::shared_ptr&lt;Container&gt; vectorPointer,
                std::function&lt;bool(Elem, Elem)&gt; comparator = std::less&lt;Elem&gt;(),
                Type type = selection) {
  
          switch (type) {
              case insertion:
                  insertionSort(vectorPointer, comparator);
              case selection:
                  selectionSort(vectorPointer, comparator);
              case merge:
                  mergeSort(vectorPointer, comparator);
          }
      }
  }
  </code></pre>
  
  <p>When I call it as such:</p>
  
  <pre><code>std::shared_ptr&lt;std::vector&lt;int&gt;&gt; intVector;
  
  Sort::sort(intVector);
  </code></pre>
  
  <p>Everything is OK, however if I start replacing the default parameters:</p>
  
  <pre><code>Sort::sort(intVector, std::less&lt;int&gt;(), merge);
  </code></pre>
  
  <p>I get an error message: <code>Candidate template ignored: could not match 'function' against 'less'</code></p>
  
  <p>Update:</p>
  
  <p>I finally made it work - explicitly specializing the function call seemed to do the trick. Also, I didn't provide the namespace for the enum value.</p>
  
  <pre><code>Sort::sort&lt;int, std::vector&lt;int&gt;&gt;(intVector, std::less&lt;int&gt;(), Sort::merge)
  </code></pre>
  
  <p>Thanks guys!</p>