title: When can outer braces be omitted in an initializer list?
body: <p>I've got error C2078 in VC2010 when compiling the code below.</p>
  
  <pre><code>struct A
    {
    int foo;
    double bar;
    };
  
  std::array&lt;A, 2&gt; a1 = 
    // error C2078: too many initializers
    {
      {0, 0.1},
      {2, 3.4}
    };
  
  // OK
  std::array&lt;double, 2&gt; a2 = {0.1, 2.3};
  </code></pre>
  
  <p>I found out that the correct syntax for <code>a1</code> is</p>
  
  <pre><code>std::array&lt;A, 2&gt; a1 = 
    {{
      {0, 0.1},
      {2, 3.4}
    }};
  </code></pre>
  
  <p>The question is: why extra braces are required for <code>a1</code> but not required for <code>a2</code>?</p>
  
  <p><strong>Update</strong></p>
  
  <p>The question seems to be not specific to std::array. Some examples:</p>
  
  <pre><code>struct B
    {
    int foo[2];
    };
  
  // OK
  B meow1 = {1,2};
  B bark1 = {{1,2}};
  
  struct C
    {
    struct 
      { 
      int a, b; 
      } foo;
    };
  
  // OK
  C meow2 = {1,2};
  C bark2 = {{1,2}};
  
  struct D
    {
    struct 
      { 
      int a, b; 
      } foo[2];
    };
  
  D meow3 = {{1,2},{3,4}};  // error C2078: too many initializers
  D bark3 = {{{1,2},{3,4}}};
  </code></pre>
  
  <p>I still don't see why <code>struct D</code> gives the error but B and C don't.</p>