title: This case of template function overloading eludes my understanding
body: <pre><code>#include &lt;iostream&gt;
  
  template&lt;typename T&gt;
  struct identity
  {
      typedef T type;
  };
  
  template&lt;typename T&gt; void bar(T) { std::cout &lt;&lt; "a" &lt;&lt; std::endl; }
  template&lt;typename T&gt; void bar(typename identity&lt;T&gt;::type) { std::cout &lt;&lt; "b" &lt;&lt; std::endl; }
  
  int main ()
  {
      bar(5); // prints "a" because of template deduction rules
      bar&lt;int&gt;(5); // prints "b" because of ...?
  
      return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>I expected <code>bar&lt;int&gt;(5)</code> to result in an ambiguity, at the very least. What crazy rule about template function overload resolution is involved here?</p>