Since C++11 introduced the range-based for loop (range-based for in c++11), what is the neatest way to express looping over a range of integers?
Instead of
for (int i=0; i<n; ++i)
I'd like to write something like
for (int i : range(0,n))
Does the new standard support anything of that kind?
Update: this article describes how to implement a range generator in C++11: Generator in C++
See Question&Answers more detail:os