Instance Methodswift-algorithms 1.2.1Algorithms
index(_:offsetBy:)
Indexed.swift:50func index(_ i: Base.Index, offsetBy distance: Int) -> Base.Index
func index(_ i: Base.Index, offsetBy distance: Int) -> Base.Index
s10Algorithms17IndexedCollectionV5index_8offsetBy5IndexQzAG_SitF
What are these?8RUFJ
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 Index : Comparable where Self.Index == Self.Indices.Element, Self.Indices.Element == Self.Indices.Index, Self.Indices.Index == Self.SubSequence.Index
A type that represents a position in the collection.
@frozen struct Int
A signed integer value type.
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 indices: Base.Indices { 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, 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.