title: C++ alignment and arrays
body: <ul>
  <li>I have some type <code>T</code> that I explicitly specify as <em>x</em>-aligned</li>
  <li><em>x</em> > <code>sizeof(T)</code></li>
  <li><em>x</em> > any implementation fundamental alignment</li>
  <li>(ex: <em>x</em> is page or cache aligned)</li>
  </ul>
  
  <p>Suppose I now have: <code>T arr[y]</code>, where <code>arr</code> is <em>x</em>-aligned (either by being allocated on the stack, or in data, or by an <em>x</em>-aligned heap allocation)</p>
  
  <p>Then at least some of <code>arr[1],...,arr[y-1]</code> are not <em>x</em>-aligned.</p>
  
  <p>Correct? (In fact, it <em>must</em> be correct if <code>sizeof(T)</code> does not change with extended alignment specification)</p>
  
  <p>Note1: This is <em>not</em> the same question as <a href="https://stackoverflow.com/questions/13284208/how-is-an-array-aligned-in-c-compared-to-a-type-contained">How is an array aligned in C++ compared to a type contained?</a>. This question asks about the alignment of the array itself, not of the individual elements inside.</p>
  
  <p>Note2: This question: <a href="https://stackoverflow.com/questions/38844505/does-alignas-affect-the-value-of-sizeof">Does alignas affect the value of sizeof?</a> is essentially what I'm asking - but for extended-alignment.</p>
  
  <p>Note3: <a href="https://stackoverflow.com/a/4638295/7226419">https://stackoverflow.com/a/4638295/7226419</a> Is an authoritative answer to the question (that <code>sizeof(T)</code> includes any padding necessary to satisfy alignment requirements for having all <code>T</code>'s in an array of <code>T</code>'s properly aligned.</p>