ChainIterator

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

struct ChainIterator<Element, First, Second>: Iterator<Element&>

ChainIterator

ChainIterator(First first, Second second)

Initializes an iterator yielding first's elements, then second's.

hasValue

bool hasValue()

Returns true if either iterator has more elements.

value

Element& value()

Returns the next element.

increment

void increment()

Advances to the next element.

chain

ChainIterator<Element, ChainIterator<Element, First, Second>, Other> chain<Other>(Other other)

Lazily appends another iterator's elements.

map

MappedIterator<Output, Element, ChainIterator<Element, First, Second>, Output(Element&)> map<Output>(Output(Element&) transform)

Lazily transforms the elements.

MappedIterator<Output, Element, ChainIterator<Element, First, Second>, Output(T)> map<Output, T: Copyable>(Output(T) transform)

Lazily transforms the elements.

filter

FilterIterator<Element, ChainIterator<Element, First, Second>, bool(Element&)> filter(bool(Element&) include)

Lazily keeps the elements satisfying the predicate.

FilterIterator<Element, ChainIterator<Element, First, Second>, bool(T)> filter<T: Copyable>(bool(T) include)

Lazily keeps the elements satisfying the predicate.

toList

List<Element> toList()

Collects the remaining elements into a list.