struct AnyRandomAccessIndex
Inheritance |
BidirectionalIndexType, Comparable, Equatable, ForwardIndexType, RandomAccessIndexType, Strideable, _Incrementable, _RandomAccessAmbiguity
View Protocol Hierarchy →
|
---|---|
Associated Types | |
Import | import Swift |
Initializers
Wrap and forward operations to base
.
Declaration
init<BaseIndex : RandomAccessIndexType>(_ base: BaseIndex)
Instance Methods
Declaration
func advancedBy(amount: Distance) -> AnyRandomAccessIndex
Declared In
AnyRandomAccessIndex
, BidirectionalIndexType
, _RandomAccessAmbiguity
, ForwardIndexType
Declaration
func advancedBy(amount: Distance, limit: AnyRandomAccessIndex) -> AnyRandomAccessIndex
Declared In
AnyRandomAccessIndex
, RandomAccessIndexType
, BidirectionalIndexType
, ForwardIndexType
Declaration
func distanceTo(other: AnyRandomAccessIndex) -> Distance
Declared In
AnyRandomAccessIndex
, ForwardIndexType
Returns the previous consecutive value in a discrete sequence of
AnyRandomAccessIndex
values.
Requires: self
has a well-defined predecessor.
Declaration
func predecessor() -> AnyRandomAccessIndex
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
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
Returns the next consecutive value in a discrete sequence of
AnyRandomAccessIndex
values.
Requires: self
has a well-defined successor.
Declaration
func successor() -> AnyRandomAccessIndex
A wrapper over an underlying
RandomAccessIndexType
that hides the specific underlying type.See Also:
AnyRandomAccessCollection