Required Associated Typeswift 6.0.3Swift
Stride
A type that represents the distance between two values.
associatedtype Stride : Comparable, SignedNumeric
A type that represents the distance between two values.
associatedtype Stride : Comparable, SignedNumeric
import Swift
protocol Strideable<Stride> : Comparable
A type representing continuous, one-dimensional values that can be offset and measured.
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol SignedNumeric : Numeric
A numeric type with a negation operation.
func advanced(by n: Self.Stride) -> Self
Returns a value that is offset the specified distance from this value.
func distance(to other: Self) -> Self.Stride
Returns the distance from this value to the given value, expressed as a stride.