MapCollectionView

struct MapCollectionView<Base : CollectionType, T>

A CollectionType whose elements consist of those in a Base CollectionType passed through a transform function returning T. These elements are computed lazily, each time they're read, by calling the transform function on a base element.

Inheritance CollectionType, SequenceType, _CollectionType, _SequenceType, _Sequence_Type View Protocol Hierarchy →
Associated Types
Generator = MapSequenceGenerator<Base.Generator, T>

Type alias inferred.

Element = T

Type alias inferred.

Index = Base.Index

Type alias inferred.

SubSequence = Slice<MapCollectionView<Base, T>>

Type alias inferred.

Import import Swift

Instance Variables

var endIndex: Base.Index

The collection's "past the end" position.

endIndex is not a valid argument to subscript, and is always reachable from startIndex by zero or more applications of successor().

Declaration

var endIndex: Base.Index { get }
var startIndex: Base.Index

The position of the first element in a non-empty collection.

Identical to endIndex in an empty collection.

Declaration

var startIndex: Base.Index { get }

Subscripts

subscript(_: Base.Index)

Declaration

subscript(position: Base.Index) -> T { get }

Instance Methods

func generate()

Return a generator over the elements of this sequence.

Complexity: O(1)

Declaration

func generate() -> MapSequenceGenerator<Base.Generator, T>