title: Neatest way to loop over a range of integers
body: <p>Since C++11 introduced the range-based for loop (<a href="https://stackoverflow.com/questions/9005835/range-based-for-in-c11">range-based for in c++11</a>), what is the neatest way to express looping over a range of integers?</p>
  
  <p>Instead of </p>
  
  <pre><code>for (int i=0; i&lt;n; ++i)
  </code></pre>
  
  <p>I'd like to write something like</p>
  
  <pre><code>for (int i : range(0,n))
  </code></pre>
  
  <p>Does the new standard support anything of that kind?</p>
  
  <p><strong>Update</strong>: this article describes how to implement a range generator in C++11: <a href="https://en.wikipedia.org/wiki/Generator_(computer_programming)#C++" rel="noreferrer">Generator in C++</a></p>