Projections
A Sequence whose elements are projections, through a lens of type BaseElementPart, of the
elements of some Base sequence.
Projections is analogous to LazyMapSequence but doesn’t store a closure or a KeyPath, and
when Base conforms to MutableCollection, so does Projections<Base, L>, as long as
L.Focus is-a WritableKeyPath.
-
The type of each element of
self. -
Single-pass iteration interface and state for instances of
See moreSelf. -
Returns an iterator over the elements of this sequence.
-
A value <=
self.count. -
A position in an instance of
Self. -
The indices of the elements in an instance of
self. -
The position of the first element, or
endIndexifself.isEmpty. -
The position immediately after the last element.
-
The indices of all elements, in order.
-
The position following
x. -
Replaces
xwith its successor -
Accesses the element at
i. -
True iff
selfcontains no elements. -
The number of elements in
self.Complexity
O(1) ifBaseconforms toRandomAccessCollection; otherwise, O(N) where N is the number of elements. -
Returns an index that is the specified distance from the given index.
Complexity
O(1) ifBaseconforms toRandomAccessCollection; otherwise, O(distance). -
Returns
ioffset forward bydistance, unless that distance is beyond a given limiting index, in which case nil is returned.Complexity
O(1) ifBaseconforms toRandomAccessCollection; otherwise, O(distance). -
Returns the number of positions between
starttoend. -
Returns the position immediately before
i. -
Replaces the value of
iwith its predecessor.
View on GitHub
Projections Structure Reference