Required Associated Typeswift 6.1.2Swift
Index
associatedtype Indexassociatedtype Indeximport Swiftprotocol RandomAccessCollection<Element> : BidirectionalCollection where Self.Indices : RandomAccessCollection, Self.SubSequence : RandomAccessCollectionA collection that supports efficient random-access index traversal.
associatedtype Indexassociatedtype Elementassociatedtype Indicesassociatedtype SubSequenceoverride var endIndex: Self.Index { get }override var indices: Self.Indices { get }The indices that are valid for subscripting the collection, in ascending order.
override var startIndex: Self.Index { get }override subscript(bounds: Range<Self.Index>) -> Self.SubSequence { get } Accesses a contiguous subrange of the collection’s elements.
override subscript(position: Self.Index) -> Self.Element { get } func distance(from start: Self.Index, to end: Self.Index) -> Int Returns the distance between two indices.
override func formIndex(after i: inout Self.Index) Replaces the given index with its successor.
override func formIndex(before i: inout Self.Index) Replaces the given index with its predecessor.
func index(_ i: Self.Index, offsetBy distance: Int) -> Self.Index Returns an index that is the specified distance from the given index.
func index(_ i: Self.Index, offsetBy distance: Int, limitedBy limit: Self.Index) -> Self.Index? Returns an index that is the specified distance from the given index, unless that distance is beyond a given limiting index.
override func index(after i: Self.Index) -> Self.Index Returns the position immediately after the given index.
override func index(before i: Self.Index) -> Self.Index Returns the position immediately before the given index.
import Cxxassociatedtype Index = Int