title: how can a for range loop infer a plain array size
body: <p>Consider this snippet:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main() {
    int s[6] {0, 1, 2, 3, 4, 5};
    for ( auto &amp;&amp; i: s ) {
      std::cout &lt;&lt; " " &lt;&lt; i &lt;&lt; std::endl;
    }
  }
  </code></pre>
  
  <p>This compiles and runs happily both under g++ and clang++.<br>
  It is taken for granted in many posts(<a href="https://stackoverflow.com/questions/32297000/passing-array-to-a-function-and-using-it-in-for-range-loop]">here</a> and <a href="https://stackoverflow.com/questions/26182907/range-based-for-loop-on-array-passed-to-non-main-function">here</a>, for example), but it is unclear to me how the compiler can correctly infer the size of the array in the <code>for range</code> for a type without iterator.<br>
  Can anyone answer or add a link to the reference?</p>