Pulled out of the other PRs #1601 #1582, this adds a simple integer range similar to Python's range, only without stride support for now. It allows writing range-for loops for (auto i : irange<int>{100}) with a slight advantage in const-correctness, since i can also be const in this context, and slightly more succinct code. With C++17 CTAD, we will also be able to omit the <int> in most cases.
Pulled out of the other PRs #1601 #1582, this adds a simple integer range similar to Python's
range
, only without stride support for now. It allows writing range-for loopsfor (auto i : irange<int>{100})
with a slight advantage in const-correctness, sincei
can also beconst
in this context, and slightly more succinct code. With C++17 CTAD, we will also be able to omit the<int>
in most cases.