title: Can two consecutive arrays of the same type be treated as one?
body: <p>Consider the follwing code:</p>
  <pre><code>struct S {
      int a[2] = {1, 1};
      int b[3] = {2, 2 ,2};
  };
  
  int main() {
      S s;
  
      for (auto *p = std::begin(s.a); p != std::end(s.a); p++)
          std::cout &lt;&lt; *p  &lt;&lt; std::endl;
  
      for (auto *p = std::begin(s.b); p != std::end(s.b); p++)
          std::cout &lt;&lt; *p  &lt;&lt; std::endl;
      
      return 0;
  }
  </code></pre>
  <p>Can I rewrite it (and still have the same result) like this?</p>
  <pre><code>struct S {
      int a[2] = {1, 1};
      int b[3] = {2, 2 ,2};
  };
  
  int main() {
      S s;
  
      for (auto *p = std::begin(s.a); p != std::end(s.b); p++)
          std::cout &lt;&lt; *p  &lt;&lt; std::endl;
      
      return 0;
  }
  </code></pre>
  <p>The <code>S</code> struct in this code is StandardLayout so there's guarantee that <code>b</code> has higher address than <code>a</code>. Is the second approach safe or there's some kind of UB?</p>
  <p>What if <code>a</code> is just an <code>int</code> (not an array). Can I do the following?</p>
  <pre><code>    for (auto *p = &amp;s.a; p != std::end(s.b); p++)
          std::cout &lt;&lt; *p  &lt;&lt; std::endl;
  </code></pre>