title: Error C2995: Function template has already been defined. No circularity found
body: <p>I had refrenced a few other similar questions, they would often point to circularity being the problem. But I cannot see that anywhere within my code. </p>
  
  <p>arrayi.cpp:</p>
  
  <pre><code>#include "arrayi.h"
  
  // Member function definitions for class Array
  
  // Initialize static data member at file scope
  template&lt;typename T&gt;
  int Array&lt;T&gt;::arrayCount = 0;   // no objects yet
  
  // Default constructor for class Array
  template&lt;typename T&gt;
  Array&lt;T&gt;::Array(int arraySize)
  {
      ++arrayCount;             // count one more object
      size = arraySize;         // default size is 10
      ptr = new int[size];      // create space for array
      assert(ptr != 0);  // terminate if memory not allocated
      int i;
      for (i = 0; i &lt; size; i++)
          ptr[i] = 0;            // initialize array
  }
  </code></pre>
  
  <p>arrayi.h:</p>
  
  <pre><code>#ifndef ARRAYI_H_
  #define ARRAYI_H_
  
  #include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;cassert&gt;
  using namespace::std;
  
  
  
  
  template&lt;typename T&gt; class Array;
  template&lt;typename T&gt;
  ostream &amp;operator&lt;&lt; (ostream&amp; output, const Array&lt;T&gt; &amp;a);
  
  
  
  
  
  template&lt;typename T&gt;
  class Array
    {
      friend ostream &amp;operator&lt;&lt; &lt;&gt;(ostream &amp;output, const Array&lt;T&gt; &amp;a);
  
  
    public:
      Array(int = 10);    //constructor
      Array(const Array &amp;);   //copy constructor
  
  
    private:
        int *ptr; //ptr to first array element
        int size; //size of the array
        static int arrayCount;    // #of arrays instantiated
   };
  
  #include "arrayi.t"
  
  #endif
  </code></pre>
  
  <p>arrayi.t:</p>
  
  <pre><code>#ifndef ARRAYI_T_
  #define ARRAYI_T_
  
  #include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;cassert&gt;
  using namespace::std;
  
  // Default constructor for class Array
  template&lt;typename T&gt;
  Array&lt;T&gt;::Array(int arraySize)
  {
  cout &lt;&lt; "calling the constructor \n";
  
  }
  
  
  
  
  // Overloaded output operator for class Array
  template&lt;typename T&gt;
  ostream &amp;operator&lt;&lt;(ostream &amp;output, const Array&lt;T&gt; &amp;a)
  {
  
    int i;
    output &lt;&lt; "{ ";
  
    for (i = 0; i &lt; a.size; i++)
      {
        output &lt;&lt; a.ptr[i] &lt;&lt; ' ';
  
        if ((i + 1) % 10 == 0)
          output &lt;&lt; "}" &lt;&lt; endl;
      }  //end for
  
    if (i % 10 != 0)
      output &lt;&lt; "}" &lt;&lt; endl;
  
    return output;   // enables cout &lt;&lt; x &lt;&lt; y;
  }
  
  
  #endif
  </code></pre>
  
  <p>I have been scanning my code up and down for quite some hours now, so any help would be much appreciated, thanks in advance! Any messy or broken looking code may be because this is from a work in progress, but there are no errors but the mentioned one at the moment. Everything shown compiles when the function "Array::Array(int arraySize)" is removed.</p>