title: Why std::array<int, 10> x is not zero-initialized but std::array<int, 10> x = std::array<int, 10>() seems to be?
body: <p>I have just asked two questions about array and value initialization <a href="https://stackoverflow.com/questions/18295302/default-initialization-of-stdarray">here</a> and <a href="https://stackoverflow.com/questions/18295614/does-int-return-0-or-an-arbitrary-value">here</a>.
  But with this code, I'm lost:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;array&gt;
  
  template &lt;class T, class U = decltype(std::declval&lt;T&gt;().at(0))&gt;
  inline U f1(const unsigned int i)
  {T x; return x.at(i);}
  
  template &lt;class T, class U = decltype(std::declval&lt;T&gt;().at(0))&gt;
  inline U f2(const unsigned int i)
  {T x = T(); return x.at(i);}
  
  int main()
  {
      static const unsigned int n = 10;
      static const unsigned int w = 20;
      for (unsigned int i = 0; i &lt; n; ++i) {
          std::cout&lt;&lt;std::setw(w)&lt;&lt;i;
          std::cout&lt;&lt;std::setw(w)&lt;&lt;f1&lt;std::array&lt;int, n&gt;&gt;(i);
          std::cout&lt;&lt;std::setw(w)&lt;&lt;f2&lt;std::array&lt;int, n&gt;&gt;(i);
          std::cout&lt;&lt;std::setw(w)&lt;&lt;std::endl;
      }
      return 0;
  }
  </code></pre>
  
  <p>As expected, <code>f1</code> return arbitrary values as its values are not zero-initialized. But <code>f2</code> seems to return exclusively zero values:</p>
  
  <pre><code>                   0                   0                   0
                     1                  61                   0
                     2                   0                   0
                     3                   0                   0
                     4           297887440                   0
                     5               32767                   0
                     6             4196848                   0
                     7                   0                   0
                     8           297887664                   0
                     9               32767                   0
  </code></pre>
  
  <p>Personally I thought that <code>f2</code> will create an array with arbitrary values and copy/move it to <code>x</code>. But it does not seem to be the case.</p>
  
  <p>So, I have two questions:</p>
  
  <ul>
  <li>Why?</li>
  <li>Do C++11 <code>std::array&lt;T, N&gt;</code> and C-style <code>T[N]</code> have the same behaviour in such a situation?</li>
  </ul>