title: An explicit specialization cannot be a friend declaration
body: <p>The code </p>
  
  <pre><code>template &lt;typename T&gt;
  void foo(const T&amp; t)
  {}
  
  template &lt;typename T&gt;
  class A
  {
      template &lt;&gt;
      friend void foo&lt;T&gt;(const T&amp; t)
      {}
  };
  </code></pre>
  
  <p>gives compile error</p>
  
  <pre><code>"defining explicit specialization ‘foo&lt;T&gt;’ in friend declaration friend void foo&lt;T&gt;(const T&amp; t)"
  </code></pre>
  
  <p>when compiling with gcc and </p>
  
  <pre><code>"error C3637: 'A&lt;int&gt;::foo' : a friend function definition cannot be a specialization of a unction template"
  </code></pre>
  
  <p>when compiling in VS2013</p>
  
  <p>I understand that standard says so, but why? I want to understand the reason(under the hood)
  There are many articles where written "An explicit specialization cannot be a friend declaration.", but I can't understand why. Any ideas?</p>