ReverseRandomAccessIndex

A wrapper for a RandomAccessIndexType that reverses its direction of traversal

Inheritance BidirectionalIndexType, Comparable, Equatable, ForwardIndexType, RandomAccessIndexType, Strideable, _BidirectionalIndexType, _Comparable, _ForwardIndexType, _Incrementable, _RandomAccessIndexType, _Strideable View Protocol Hierarchy →
Import
  • import Swift

Instance Methods

func advancedBy(_:)

Return self offset by n steps.

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.

Complexity: O(1)

Declaration

func distanceTo(_:)

Return the minimum number of applications of successor or predecessor required to reach other from self.

Complexity: O(1).

Declaration

func predecessor()

Returns the previous consecutive value before self.

Requires: the previous value is representable.

Declaration

func successor()

Returns the next consecutive value after self.

Requires: the next value is representable.

Declaration