title: multi-dimensional array initialization based on std::array
body: <p>After seeing the benefits of std::array I was trying to create a class that supports multiple dimensions.</p>
  
  <p>My initial experiments used nested std::array. I chose not to use this method partly for the ugly way to write the type.</p>
  
  <p>ie: <code>std::array&lt;std::array&lt;std::array&lt;...&gt;, &gt;, &gt;</code></p>
  
  <p>The new class is mostly working except for initialization. I haven't decided whether its best to use inheritance or containment. The choice may depend on whether I can get initialization working.</p>
  
  <p>How can I get either of the last two lines of this to compile:</p>
  
  <pre><code>// multi-dimensional array based on std::array
  
  #include &lt;array&gt;
  
  template &lt;class T, int s, int... r&gt;
  class arraynd_a : public std::array&lt;arraynd_a&lt;T, r...&gt;, s&gt;
  {
  public:
  };
  
  template &lt;class T, int s&gt;
  class arraynd_a&lt;T, s&gt; : public std::array&lt;T, s&gt;
  {
  public:
  };
  
  template &lt;class T, int s, int... r&gt;
  class arraynd_b
  {
  public:
      std::array&lt;arraynd_b&lt;T, r...&gt;, s&gt; arr;
  };
  
  template &lt;class T, int s&gt;
  class arraynd_b&lt;T, s&gt;
  {
  public:
      std::array&lt;T, s&gt; arr;
  };
  
  void test()
  {
      constexpr std::array&lt;std::array&lt;int, 2&gt;, 3&gt; a1 = { { { 0, 1 }, { 1, 0 }, { 2, 4 } } };
      /*constexpr*/ arraynd_a&lt;int, 3, 2&gt; a2a;
      /*constexpr*/ arraynd_b&lt;int, 3, 2&gt; a2b;
  #if 0
      /*constexpr*/ arraynd_a&lt;int, 3, 2&gt; a3a =  { { { 0, 1 }, { 1, 0 }, { 2, 4 } } };
  #endif
  #if 0
      /*constexpr*/ arraynd_b&lt;int, 3, 2&gt; a3b =  { { { 0, 1 }, { 1, 0 }, { 2, 4 } } };
  #endif
  }
  </code></pre>