title: Is it possible to access a C++ 2D int array using a 1D index?
body: <p>As per title, I'm looking for a way to access a 2D int array using a single precomputed index.</p>
  <p>In other words, I'd like to do <code>array[z]</code> instead of <code>array[x][y]</code>, with 'array' remaining an <code>int[][]</code></p>
  <p>Is there a way of casting the array to a 1D array without any overhead?</p>
  <p>I would like to avoid using pointers (at least in the sense <code>*(&amp;array[0][0] + index)</code>), since this is performance critical and in all my testing they are slower. <em>(EDIT: This was with a particular set of optimisation flags on an old MSVC compiler - generally not the case.)</em> I would also like to avoid any arithmetic or function calls, unless they're lighter than just accessing the array in 2D format.</p>