AnyRandomAccessIndex

struct AnyRandomAccessIndex

A wrapper over an underlying RandomAccessIndexType that hides the specific underlying type.

See Also: AnyRandomAccessCollection

Inheritance BidirectionalIndexType, Comparable, Equatable, ForwardIndexType, RandomAccessIndexType, Strideable, _Incrementable, _RandomAccessAmbiguity View Protocol Hierarchy →
Associated Types
Distance = IntMax
Import import Swift

Initializers

init(_:)

Wrap and forward operations to base.

Declaration

init<BaseIndex : RandomAccessIndexType>(_ base: BaseIndex)

Instance Methods

func advancedBy(_:)

Declaration

func advancedBy(amount: Distance) -> AnyRandomAccessIndex

Declared In

AnyRandomAccessIndex, BidirectionalIndexType, _RandomAccessAmbiguity, ForwardIndexType
func advancedBy(_:limit:)

Declaration

func advancedBy(amount: Distance, limit: AnyRandomAccessIndex) -> AnyRandomAccessIndex

Declared In

AnyRandomAccessIndex, RandomAccessIndexType, BidirectionalIndexType, ForwardIndexType
func distanceTo(_:)

Declaration

func distanceTo(other: AnyRandomAccessIndex) -> Distance

Declared In

AnyRandomAccessIndex, ForwardIndexType
func predecessor()

Returns the previous consecutive value in a discrete sequence of AnyRandomAccessIndex values.

Requires: self has a well-defined predecessor.

Declaration

func predecessor() -> AnyRandomAccessIndex
func stride(through:by:)

Returns the sequence of values (self, self + stride, self + stride + stride, ... last) where last is the last value in the progression less than or equal to end.

Note: There is no guarantee that end is an element of the sequence.

Declaration

func stride(through end: AnyRandomAccessIndex, by stride: AnyRandomAccessIndex.Stride) -> StrideThrough<AnyRandomAccessIndex>

Declared In

Strideable
func stride(to:by:)

Returns the sequence of values (self, self + stride, self + stride + stride, ... last) where last is the last value in the progression that is less than end.

Declaration

func stride(to end: AnyRandomAccessIndex, by stride: AnyRandomAccessIndex.Stride) -> StrideTo<AnyRandomAccessIndex>

Declared In

Strideable
func successor()

Returns the next consecutive value in a discrete sequence of AnyRandomAccessIndex values.

Requires: self has a well-defined successor.

Declaration

func successor() -> AnyRandomAccessIndex