title: Template operator overload in source file instead of header
body: <p>I made a simple <code>Vector2</code> Template class which I use to store an <code>X</code> and an <code>Y</code> value. Now I'm trying to keep implementation of templates in the source files, but I fail to do this with operator overloading</p>
  
  <pre><code>    class Vector2
      {
      public:
          Vector2&lt;Type&gt;();
          Vector2&lt;Type&gt;(Type x, Type y);
          Vector2&lt;Type&gt;(const Vector2&lt;Type&gt; &amp;v);
          ~Vector2&lt;Type&gt;();
          Vector2&lt;Type&gt; operator+ (const Vector2&lt;Type&gt; &amp;other)
          {
              return Vector2&lt;Type&gt;(x + other.x, y + other.y);
          }
      private:
          Type x, y;
      };
  </code></pre>
  
  <p>Now this compiles and works just fine but this is currently located in the header file. Implementing the constructor and de-constructor of <code>Vector2</code> works perfectly fine aswell but when I try the following:</p>
  
  <p>.h:</p>
  
  <pre><code>    Vector2&lt;Type&gt; operator+ (const Vector2&lt;Type&gt; &amp;other);
  </code></pre>
  
  <p>.cpp:</p>
  
  <pre><code>    template &lt;class Type&gt;
      Vector2&lt;Type&gt;::operator+ (const Vector2&lt;Type&gt; &amp;other)
      {
          return Vector2&lt;Type&gt;(x + other.x, y + other.y);
      }
  </code></pre>
  
  <p>the compiler tells me:
  <code>missing type specifier - int assumed. Note C++ does not support default-int</code></p>
  
  <p>Kind regards, Me</p>