title: Why aren't these overloads ambiguous?
body: <p>The following code compiles fine with gcc and clang.</p>
  
  <pre><code>template &lt;typename T&gt;
  struct identity
  {
      typedef T type;
  };
  
  template &lt;typename T&gt;
  void foo(typename identity&lt;T&gt;::type);
  
  template &lt;typename T&gt;
  void foo(T);
  
  int main()
  {
      foo&lt;int&gt;(0);
  }
  </code></pre>
  
  <p>It looks like overload resolution is choosing the first overload (the <code>identity&lt;T&gt;::type</code> one).</p>
  
  <p>Could someone explain why the overloads aren't ambiguous? As far as I can tell, the only difference between them is that the argument of the first one is a non-deduced context and the argument of the second one isn't, but since I'm providing the template argument explicitly, I don't see why that should matter.</p>