title: In C++, how to iterate array in reverse using for_each?
body: <p>In C++11, using lambda/for_each, how do we iterate an array from end?</p>
  
  <p>I tried the following, but both result in infinite loop:</p>
  
  <pre><code>for_each (end(A), begin(A), [](int i) {
     ....
  });
  
  for_each (A.rend(), A.rbegin(), [](int i) {
      ...
  });
  </code></pre>
  
  <p>Any idea? Thanks.   </p>