IteratorSequence

    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) { ... }

    Citizens in Swift

    Type members

    • init(Base)

      Creates an instance whose iterator is a copy of base.

    Citizens in Swift

    where Base:IteratorProtocol

    Conformances

    Typealiases

    Instance members

    Instance features

    Show obsolete interfaces (1)

    Hide obsolete interfaces

    Citizens in Swift

    where Base:IteratorProtocol, Base:Sendable

    Conformances