RepeatIterator

RepeatIterator: RepeatIterator, hasValue, value, increment, toList

struct RepeatIterator<T: Copyable>: Copyable, Iterator<T&>

RepeatIterator

RepeatIterator(T value, int count)

Initializes an iterator yielding value count times.

hasValue

bool hasValue()

Returns true if there are repetitions remaining.

value

T& value()

Returns the repeated value.

increment

void increment()

Advances to the next repetition.

toList

List<T> toList()

Collects the repetitions into a list.