title: Range-based for statement definition redundancy
body: <p>Looking at n3092, in §6.5.4 we find the equivalency for a range-based for loop. It then goes on to say what <code>__begin</code> and <code>__end</code> are equal to. It differentiates between arrays and other types, and I find this redundant (aka confusing).</p>
  
  <p>It says for arrays types that <code>__begin</code> and <code>__end</code> are what you expect: a pointer to the first and a pointer to one-past the end. Then for other types, <code>__begin</code> and <code>__end</code> are equal to <code>begin(__range)</code> and <code>end(__range)</code>, with ADL. Namespace <code>std</code> is associated, in order to find the <code>std::begin</code> and <code>std::end</code> defined in <code>&lt;iterator&gt;</code>, §24.6.5.</p>
  
  <p>However, if we look at the definition of <code>std::begin</code> and <code>std::end</code>, they are both defined for arrays as well as container types. And the array versions do exactly the same as above: pointer to the first, pointer to one-past the end.</p>
  
  <p>Why is there a need to differentiate arrays from other types, when the definition given for other types would work just as well, finding <code>std::begin</code> and <code>std::end</code>?</p>
  
  <hr>
  
  <p><sub>Some abridged quotes for convenience:</sub></p>
  
  <blockquote>
    <h3>§6.5.4 The range-based <code>for</code> statement</h3>
    
    <p>— if _RangeT is an array type, begin-expr and end-expr are __range and __range + __bound, respectively, where __bound is the array bound. If _RangeT is an array of unknown size or an array of incomplete type, the program is ill-formed.  </p>
    
    <p>— otherwise, begin-expr and end-expr are begin(__range) and end(__range), respectively, where begin and end are looked up with argument-dependent lookup (3.4.2). For the purposes of this name lookup, namespace std is an associated namespace.</p>
  </blockquote>
  
  <p><b></b></p>
  
  <blockquote>
    <h3>§24.6.5 range access</h3>
  
  <pre><code>template &lt;class T, size_t N&gt; T* begin(T (&amp;array)[N]);
  </code></pre>
    
    <p>Returns: array.</p>
  
  <pre><code>template &lt;class T, size_t N&gt; T* end(T (&amp;array)[N]);
  </code></pre>
    
    <p>Returns: array + N.</p>
  </blockquote>