title: initialize std::array <struct, size>
body: <p>I am trying to defined and initialize an array of struct.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;array&gt;
  
  int main() {
      struct row{
          double a0;
          double a1;
      };
  
      //method 0: this way works
      row c[2] ={{1.0,2.0},{3.0,4.0}};
  
      //method 1: declare and initialization in same line 
      //std::array&lt;row, 2&gt; a = { {1.0, 2.0}, {3.0, 4.0} };//error: Excess elements in struct initializer
      std::array&lt;row, 2&gt; a = {{ {1.0, 2.0}, {3.0, 4.0} }}; //double brace
  
  
      //method 2, declare, then initialize in different line
      std::array&lt;row, 2&gt; b;
      //b = { {1.0, 2.0}, {3.0, 4.0} };//error: No viable overloaded '='
      b = { { {1.0, 2.0}, {3.0, 4.0} } }; //double brace
  
      return 0;
  }
  </code></pre>
  <p>Now I find double brace works from <a href="https://stackoverflow.com/questions/33586315/initialise-a-c-stdarray-of-struct-in-c11">this post</a>.</p>
  <p>Just wondering why do we need extra pair of brace to initialize array of struct?</p>