A sequence built around an iterator of type Base.

@frozen struct IteratorSequence<Base> where Base : IteratorProtocol


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

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



  • 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