StructureSwift

IteratorSequence

A sequence built around an iterator of type Base.

@frozen struct IteratorSequence<Base> where Base : IteratorProtocol

Overview

Useful mostly to recover the ability to use forin, given just an iterator i:

for x in IteratorSequence(i) { ... }

Members

Initializers

  • init(Base)

    Creates an instance whose iterator is a copy of base.

Instance Properties

  • var lazy: LazySequence<Self>

    A sequence containing the same elements as this sequence, but on which some operations, such as map and filter, are implemented lazily.

  • var underestimatedCount: Int

    A value less than or equal to the number of elements in the sequence, calculated nondestructively.

Instance Methods

Conforms To

Removed Members