title: Linker error when operator== is a friend
body: <p>The following code is a minimum code to reproduce my problem. When I try to compile it, the linker can not find <code>operator==</code> for <code>Config</code>:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "operator==(Config&lt;2&gt; const&amp;, Config&lt;2&gt; const&amp;)", referenced from:
            _main in test2.o
  </code></pre>
  
  <p>The <code>operator==</code> is a friend of <code>Config</code>. BUT when I do no longer declare <code>operator==</code> as a friend, the code compilers with no error.</p>
  
  <pre><code>template &lt;int DIM&gt;
  class Config{
      // comment the following line out and it works
      friend bool operator==(const Config&lt;DIM&gt;&amp; a, const Config&lt;DIM&gt;&amp; b);
  
      public:
          int val;
  };
  
  template &lt;int DIM&gt;
  bool operator==(const Config&lt;DIM&gt;&amp; a, const Config&lt;DIM&gt;&amp; b){
      return a.val == b.val;
  }
  
  int main() {
      Config&lt;2&gt; a;
      Config&lt;2&gt; b;
      a == b;
      return 0;
  }
  </code></pre>
  
  <p>What is the problem here?</p>