A type-erased iterator of Element.

@frozen struct AnyIterator<Element>


This iterator forwards its next() method to an arbitrary underlying iterator having the same Element type, hiding the specifics of the underlying IteratorProtocol.



  • init(() -> Element?)

    Creates an iterator that wraps the given closure in its next() method.

  • init<I>(I)

    Creates an iterator that wraps a base iterator but whose type depends only on the base iterator’s element type.

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