title: What is the sizeof std::array<char, N>?
body: <p>What does the C++ standard say about what <code>sizeof(std::array&lt;char, N&gt;)</code> should be (for some constant <code>N</code>)?</p>
  
  <p>In a <a href="https://stackoverflow.com/questions/25172879/memory-layout-2d-nm-data-as-pointer-to-nm-buffer-or-as-array-of-n-pointers-t/25173173#comment39195129_25173173">comment to a different question</a>, it was mentioned that <code>std::array</code> is not always "stack allocated". The comment was in response to a different comment that speculated that putting a too large of a constant for <code>std::array</code> that is declared as a local variable could cause the program to abort due to insufficient resources for the "stack allocated" variable. I assume the followup comment meant that it would be possible for <code>std::array</code> to somehow switch to a dynamic allocation mode.</p>
  
  <p>I could imagine that there could be some kind of SFINAE could be applied for an array size threshold that triggers a specialization of <code>std::array</code> that actually dynamically allocates an array and manages it. In that case, the <code>sizeof(std::array&lt;...&gt;)</code> might just be the size of a pointer. Is that allowed to happen?</p>