Possible Duplicate:
Is there a range class in C++11 for use with range based for loops?
I.e. is there a standard range with iterator that will dereference to an integer?
I’m thinking about something like this:
for (int i : rangeTo(10)) { ... }
for (int i : rangeFromTo(10, 20)) { .... }
No, but there is
boost::irange:and
boost::counting_rangeThe difference is you can add a step, for
boost::irange(10, 20, 2).