SequenceOf

struct SequenceOf<T>

A type-erased sequence.

Forwards operations to an arbitrary underlying sequence with the same Element type, hiding the specifics of the underlying sequence type.

See also: GeneratorOf<T>.

Inheritance SequenceType, _SequenceType, _Sequence_Type View Protocol Hierarchy →
Associated Types
Generator = GeneratorOf<T>

Type alias inferred.

Element = Generator.Element

Type alias inferred.

Import import Swift

Initializers

init<S : SequenceType where T == T>(_: S)

Construct an instance whose generate() method forwards to that of base.

Declaration

init<S : SequenceType where T == T>(_ base: S)
init<G : GeneratorType where T == T>(_: () -> G)

Construct an instance whose generate() method forwards to makeUnderlyingGenerator

Declaration

init<G : GeneratorType where T == T>(_ makeUnderlyingGenerator: () -> G)

Instance Methods

func generate()

Return a generator over the elements of this sequence.

Complexity: O(1)

Declaration

func generate() -> GeneratorOf<T>