#include <darts/common.h>
template<typename T>
Range class
Python-style range: iterates from min to max in range-based for loops.
To use:
for(int i = 0; i < 100; i++) { ... } // old way for(auto i : range(100)) { ... } // new way for(int i = 10; i < 100; i+=2) { ... } // old way for(auto i : range(10, 100, 2)) { ... } // new way for(float i = 3.5f; i > 1.5f; i-=0.01f) { ... } // old way for(auto i : range(3.5f, 1.5f, -0.01f)) { ... } // new way
Constructors, destructors, conversion operators
- Range(T start, T end, T step = T(1))
- Construct an iterable range from
start
toend
in increments ofstep
.