FlattenBidirectionalCollectionIndex

struct FlattenBidirectionalCollectionIndex<BaseElements : CollectionType where BaseElements.Generator.Element : CollectionType, BaseElements.Index : BidirectionalIndexType, BaseElements.Generator.Element.Index : BidirectionalIndexType>

A position in a FlattenBidirectionalCollection.

Inheritance BidirectionalIndexType, Equatable, ForwardIndexType, _Incrementable View Protocol Hierarchy →
Import import Swift

Instance Methods

func advancedBy(_:)

Returns the result of advancing self by n positions.

Returns: - If n > 0, the result of applying successor to self n times. - If n < 0, the result of applying predecessor to self -n times. - Otherwise, self.

Requires: n >= 0 if only conforming to ForwardIndexType Complexity: - O(1) if conforming to RandomAccessIndexType - O(abs(n)) otherwise

Declaration

func advancedBy(n: FlattenBidirectionalCollectionIndex<BaseElements>.Distance) -> FlattenBidirectionalCollectionIndex<BaseElements>

Declared In

BidirectionalIndexType, ForwardIndexType
func advancedBy(_:limit:)

Returns the result of advancing self by n positions, or until it equals limit.

Returns: - If n > 0, the result of applying successor to self n times but not past limit. - If n < 0, the result of applying predecessor to self -n times but not past limit. - Otherwise, self.

Requires: n >= 0 if only conforming to ForwardIndexType.

Complexity: - O(1) if conforming to RandomAccessIndexType - O(abs(n)) otherwise

Declaration

func advancedBy(n: FlattenBidirectionalCollectionIndex<BaseElements>.Distance, limit: FlattenBidirectionalCollectionIndex<BaseElements>) -> FlattenBidirectionalCollectionIndex<BaseElements>

Declared In

BidirectionalIndexType, ForwardIndexType
func distanceTo(_:)

Measure the distance between self and end.

Requires: - start and end are part of the same sequence when conforming to RandomAccessSequenceType. - end is reachable from self by incrementation otherwise.

Complexity: - O(1) if conforming to RandomAccessIndexType - O(n) otherwise, where n is the function's result.

Declaration

func distanceTo(end: FlattenBidirectionalCollectionIndex<BaseElements>) -> FlattenBidirectionalCollectionIndex<BaseElements>.Distance

Declared In

BidirectionalIndexType, ForwardIndexType
func predecessor()

Returns the previous consecutive value before self.

Requires: The previous value is representable.

Declaration

func predecessor() -> FlattenBidirectionalCollectionIndex<BaseElements>
func successor()

Returns the next consecutive value after self.

Requires: The next value is representable.

Declaration

func successor() -> FlattenBidirectionalCollectionIndex<BaseElements>