title: C++: Fill array according to template parameter
body: <p>Essentially, the situation is as follows:</p>
  
  <p>I have a class template (using one template parameter <code>length</code> of type <code>int</code>) and want to introduce a static array. This array should be of length <code>length</code> and contain the elements <code>1</code> to <code>length</code>.</p>
  
  <p>The code looks as follows up to now:</p>
  
  <pre><code>template&lt;int length&gt;
  class myClass{
      static int array[length];
  };
  </code></pre>
  
  <p>Then I wanted to write a line for initalizing the array</p>
  
  <pre><code>// of course, the line below does not work as intended.
  template&lt;int length&gt; int myClass&lt;length&gt;::array[length]={1,2, ..., length};
  </code></pre>
  
  <p>(How) can this be achieved?</p>