MappedIterator

MappedIterator: MappedIterator, hasValue, value, increment, map, filter, chain, toList

struct MappedIterator<Output, Input, It, Transform>: Iterator<Output&>

MappedIterator

MappedIterator(It source, Transform transform)

Initializes an iterator transforming the source's elements.

hasValue

bool hasValue()

Returns true if there are more elements.

value

Output& value()

Returns the next transformed element.

increment

void increment()

Advances to the next element.

map

MappedIterator<Output2, Output, MappedIterator<Output, Input, It, Transform>, Output2(Output&)> map<Output2>(Output2(Output&) transform)

Lazily transforms the elements.

MappedIterator<Output2, Output, MappedIterator<Output, Input, It, Transform>, Output2(T)> map<Output2, T: Copyable>(Output2(T) transform)

Lazily transforms the elements.

filter

FilterIterator<Output, MappedIterator<Output, Input, It, Transform>, bool(Output&)> filter(bool(Output&) include)

Lazily keeps the elements satisfying the predicate.

FilterIterator<Output, MappedIterator<Output, Input, It, Transform>, bool(T)> filter<T: Copyable>(bool(T) include)

Lazily keeps the elements satisfying the predicate.

chain

ChainIterator<Output, MappedIterator<Output, Input, It, Transform>, Other> chain<Other>(Other other)

Lazily appends another iterator's elements.

toList

List<Output> toList()

Collects the remaining elements into a list.