RangeIterator
RangeIterator: RangeIterator, hasValue, value, increment, print, toList, sum
struct RangeIterator<T>: Iterator<T>, Printable
Iterates over the values of a range.
RangeIterator
RangeIterator(Range<T> range)Initializes an iterator over the given range.
hasValue
bool hasValue()Returns true if there are more values.
value
T value()Returns the current value.
increment
void increment()Advances to the next value.
void print(OutputStream& stream)Prints the remaining values in list form, e.g. [1, 2, 3].
toList
List<T> toList()Collects the remaining values into a list.
sum
T sum()Returns the sum of the remaining elements, or zero if there are none.