Instance Propertyswift-algorithms 1.2.1Algorithms
indices
Indexed.swift:69var indices: Base.Indices { get }
var indices: Base.Indices { get }
where Base:Collection
import Algorithms
Swift Algorithms is an open-source package of sequence and collection algorithms, along with their related types.
struct IndexedCollection<Base> where Base : Collection
A collection wrapper that iterates over the indices and elements of a collection together.
associatedtype Indices : Collection = DefaultIndices<Self> where Self.Indices == Self.Indices.SubSequence
A type that represents the indices that are valid for subscripting the collection, in ascending order.
protocol Collection<Element> : Sequence
A sequence whose elements can be traversed multiple times, nondestructively, and accessed by an indexed subscript.
var endIndex: Base.Index { get }
var startIndex: Base.Index { get }
subscript(position: Base.Index) -> Element { get }
func distance(from start: Base.Index, to end: Base.Index) -> Int
func index(_ i: Base.Index, offsetBy distance: Int) -> Base.Index
func index(_ i: Base.Index, offsetBy distance: Int, limitedBy limit: Base.Index) -> Base.Index?
func index(after i: Base.Index) -> Base.Index
typealias Element = (index: Base.Index, element: Base.Element)
The element type for an IndexedCollection
collection.