#include <darts/common.h>
template<int N, typename T>
RangeND class
Python-style range, but for nested, multi-dimensional loops (up to 4 dimensions).
To use:
for (int z = 0; z < 5; z++) // old way for (int y = 0; y < 7; y++) for (int x = 0; x < 3; z++) { ... use x, y, z } for (auto i : range<3,int>({3, 7, 5})) // new way { ... use i.x, i.y, i.z } for (int y = -6; y < 7; y++) // old way for (int x = -2; x < 3; z++) { ... use x, y } for (auto i : range<2,int>({-2, -6}, {3, 7})) // new way { ... use i.x, i.y }