struct
ReverseRandomAccessIndex
<
Base
:
RandomAccessIndex
>
Inheritance |
BidirectionalIndex, Comparable, Equatable, ForwardIndex, RandomAccessIndex, ReverseIndexProtocol, Strideable, _Incrementable, _RandomAccessAmbiguity
View Protocol Hierarchy →
|
---|---|
Associated Types |
|
Import |
|
Initializers
Declaration
init
(
_
base
:
Base
)
Instance Variables
The successor position in the underlying (un-reversed) collection.
If self
is advance(c.reverse.startIndex, n)
, then:
- self.base
is advance(c.endIndex, -n)
.
- if n
!= c.count
, then c.reverse[self]
is
equivalent to [self.base.predecessor()]
.
Declaration
var
base
:
Base
{
get
}
Instance Methods
Declaration
func
advanced
(
by
n
:
Base
.
Distance
) -
>
ReverseRandomAccessIndex
<
Base
>
Declared In
ReverseRandomAccessIndex
, RandomAccessIndex
, ReverseIndexProtocol
, BidirectionalIndex
, _RandomAccessAmbiguity
, ForwardIndex
Declaration
func
advanced
(
by
n
:
ReverseRandomAccessIndex
<
Base
>
.
Distance
,
limit
:
ReverseRandomAccessIndex
<
Base
>
) -
>
ReverseRandomAccessIndex
<
Base
>
Declared In
RandomAccessIndex
, ReverseIndexProtocol
, BidirectionalIndex
, ForwardIndex
Declaration
func
distance
(
to
other
:
ReverseRandomAccessIndex
<
Base
>
) -
>
Base
.
Distance
Declared In
ReverseRandomAccessIndex
, RandomAccessIndex
, ReverseIndexProtocol
, BidirectionalIndex
, ForwardIndex
Returns the previous consecutive value before self
.
Precondition: The previous value is representable.
Declaration
func
predecessor
() -
>
ReverseRandomAccessIndex
<
Base
>
Declared In
BidirectionalIndex
Returns the next consecutive value after self
.
Precondition: The next value is representable.
Declaration
func
successor
() -
>
ReverseRandomAccessIndex
<
Base
>
Declared In
BidirectionalIndex
3 inherited items hidden. (Show all)
A wrapper for a
RandomAccessIndex
that reverses its direction of traversal.