title: Why would this template not compile?
body: <p>I have a pretty simple template which is a container which is an array of T. I am getting a syntax error :</p>
  
  <p>container.h(7): error C2143: syntax error : missing ';' before '&amp;'. I have tried removing the declaration there but then the error just skips over to the definition. Would appreciate any help.</p>
  
  <p>EDIT: now i fixed the using namespace thing, but another error popped: 
  container.h(8): error C2975: 'Container' : invalid template argument for 'unnamed-parameter', expected compile-time constant expression</p>
  
  <pre><code>#include &lt;typeinfo.h&gt;
  #include &lt;assert.h&gt;
  #include &lt;iostream&gt;
  #pragma once
  
  using namespace std; 
  template &lt;typename T, int&gt; class Container;
  template &lt;typename T, int&gt; ostream&amp; operator&lt;&lt; &lt;&gt;(ostream &amp;, const Container&lt;T,int&gt; &amp;);
  
  template&lt;class T , int capacity=0&gt; class Container
  {
      //using namespace std;
  private:
      T inside[capacity];
  public:
      Container()
      {
  
      }
  
      ~Container(void)
      {
      }
  
      void set(const T &amp;tType, int index)
      {
          assert(index&gt;=0 &amp;&amp; index&lt;= capacity);
          inside[index] = tType;
      }
  
      T&amp; operator[](int index)
      {
          assert(index&gt;=0 &amp;&amp; index&lt;= capacity);
          return inside[index];
      }
  
      friend ostream&amp; operator&lt;&lt; &lt;&gt;(ostream&amp; out, const Container&lt;T,int&gt; c);
      {
          for(int i=0;i&lt;sizeof(inside)/sizeof(T);i++)
              out&lt;&lt;c.inside[i]&lt;&lt; "\t";
          return out;
      }
  };
  </code></pre>