title: Instantiate an object of template class type in C++
body: <p>I am having troubles instantiating an object of a template class type in C++.</p>
  
  <p>Here is the code:</p>
  
  <p>Array.h:</p>
  
  <pre><code>//Developed by Trofimov Yaroslav on 30.03.2018
  
  #ifndef _ARRAY_H_TROFIMOV_
  #define _ARRAY_H_TROFIMOV_
  
  template&lt;size_t n, typename T&gt;
  class Array
  {
          static unsigned __freeId, __quantity;
          unsigned _id;
  
          T* _array;
  public:
          template&lt;size_t n, typename T&gt;
          Array(void);
          ~Array(void);
          T&amp; operator[](const size_t);
  };
  #include "Array.cpp"
  
  #endif
  </code></pre>
  
  <p>Array.cpp:</p>
  
  <pre><code>//Developed by Trofimov Yaroslav on 30.03.2018
  #include "Array.h"
  
  template&lt;size_t n, typename T&gt;
  Array::Array(void) 
      : _id(++__freeId), _array(new T[]) {
  
  }
  
  template&lt;size_t n, typename T&gt;
  Array::~Array(void) {
  
  }
  
  template&lt;size_t n, typename T&gt;
  T&amp; Array::operator[](const size_t i) {
  
  }
  </code></pre>
  
  <p>Main.cpp:</p>
  
  <pre><code>//Developed by Trofimov Yaroslav on 30.03.2018
  #include &lt;iostream&gt;
  #include "Array.h"
  
  int main(void) {
      Array&lt;7, int&gt; a;
      return 0;
  }
  </code></pre>
  
  <p>Now when I hover over <code>a</code> in <code>Main.cpp</code> I see the following:</p>
  
  <blockquote>
    <p>Error: no default constructor exists for class "Array&lt;7U, int>"</p>
  </blockquote>
  
  <p>But as you can see, the default template constructor does exist. So, what am I missing here?</p>