title: Difference between irange and counting_range in Boost
body: <p>What's the difference between <a href="http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/range/reference/ranges/irange.html" rel="noreferrer"><code>irange</code></a> and <a href="http://www.boost.org/doc/libs/1_47_0/libs/range/doc/html/range/reference/ranges/counting_range.html" rel="noreferrer"><code>counting_range</code></a>?</p>
  
  <p>I needed <code>irange</code> to quickly generate a range of integers like this:</p>
  
  <pre><code>auto example = boost::irange(0, 5); /// result is {0, 1, 2, 3, 4}
  </code></pre>
  
  <p>But noticed an example somewhere (lost the link) that talks instead about <code>counting_range</code> to accomplish the same task. Is there a simple explanation of the difference between these two?</p>