title: Class declaration and implementation in the header file
body: <p>I have an assignment at my university. My task is to complete two header files with the implementation of the given classes. It is important to implement in those header files, because it will be tested by unit tests and only the header files will be tested.</p>
  
  <p>Let's say I have this <strong>.h</strong> file:</p>
  
  <pre><code>#pragma once
  
  template&lt;class T&gt;
  class RareVector;
  
  template&lt;class T&gt;
  class Vector
  {
  public:
  Vector(){}
  Vector(int dim);
  Vector(T *t, int dim);
  Vector(const Vector&amp;);
  ~ Vector();
  
  Vector operator+(const Vector&amp;);
  Vector operator-(const Vector&amp;);
  double operator*(const Vector&amp;);
  double operator~();
  double operator%(const Vector&amp;);
  T      operator[](int) const;
  operator RareVector&lt;T&gt;();
  
  private:
  T*  m_t;
  int m_dim;
  };
  </code></pre>
  
  <p><strong>My question is:</strong> the only place to implement these classes is at the declaration, or I can do something like this somewhere below:</p>
  
  <pre><code>template &lt;class T&gt;
  Vector&lt;T&gt;::Vector(){
  // code goes here
  }
  </code></pre>