Index
An index that traverses the same positions as an underlying index, with inverted traversal direction.
@frozen struct Index
An index that traverses the same positions as an underlying index, with inverted traversal direction.
@frozen struct Index
where Base:BidirectionalCollection
import Swift
@frozen struct ReversedCollection<Base> where Base : BidirectionalCollection
A collection that presents the elements of its base collection in reverse order.
protocol BidirectionalCollection<Element> : Collection where Self.Indices : BidirectionalCollection, Self.SubSequence : BidirectionalCollection
A collection that supports backward as well as forward traversal.
var endIndex: ReversedCollection<Base>.Index { get }
var startIndex: ReversedCollection<Base>.Index { get }
subscript(position: ReversedCollection<Base>.Index) -> ReversedCollection<Base>.Element { get }
func distance(from start: ReversedCollection<Base>.Index, to end: ReversedCollection<Base>.Index) -> Int
func index(_ i: ReversedCollection<Base>.Index, offsetBy n: Int) -> ReversedCollection<Base>.Index
func index(_ i: ReversedCollection<Base>.Index, offsetBy n: Int, limitedBy limit: ReversedCollection<Base>.Index) -> ReversedCollection<Base>.Index?
func index(after i: ReversedCollection<Base>.Index) -> ReversedCollection<Base>.Index
func index(before i: ReversedCollection<Base>.Index) -> ReversedCollection<Base>.Index
func makeIterator() -> ReversedCollection<Base>.Iterator
func reversed() -> Base
Reversing a reversed collection returns the original collection.
@frozen struct Iterator
typealias Element = Base.Element
A type that represents a valid position in the collection.
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
init(_ base: Base.Index)
Creates a new index into a reversed collection for the position before the specified index.
let base: Base.Index
The position after this position in the underlying collection.
static func < (lhs: ReversedCollection<Base>.Index, rhs: ReversedCollection<Base>.Index) -> Bool
static func == (lhs: ReversedCollection<Base>.Index, rhs: ReversedCollection<Base>.Index) -> Bool
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func ... (minimum: Self) -> PartialRangeFrom<Self>
Returns a partial range extending upward from a lower bound.
static func ... (maximum: Self) -> PartialRangeThrough<Self>
Returns a partial range up to, and including, its upper bound.
static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self>
Returns a closed range that contains both of its bounds.
static func ..< (maximum: Self) -> PartialRangeUpTo<Self>
Returns a partial range up to, but not including, its upper bound.
static func ..< (minimum: Self, maximum: Self) -> Range<Self>
Returns a half-open range that contains its lower bound but not its upper bound.
static func <= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func > (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func >= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
func hash(into hasher: inout Hasher)
Hashes the essential components of this value by feeding them into the given hasher.
protocol Sendable