Strideable

protocol Strideable

Conforming types are notionally continuous, one-dimensional values that can be offset and measured.

Inheritance Comparable, Equatable View Protocol Hierarchy →
Associated Types
Stride : SignedNumber

A type that can represent the distance between two values of Self.

Import import Swift

Instance Methods

func <(_:rhs:) Required

Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.

This function is the only requirement of the Comparable protocol. The remainder of the relational operator functions are implemented by the standard library for any type that conforms to Comparable.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func <(lhs: Self, rhs: Self) -> Bool

Declared In

Comparable
func <=(_:rhs:)

Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func <=(lhs: Self, rhs: Self) -> Bool

Declared In

Comparable
func ==(_:rhs:) Required

Returns a Boolean value indicating whether two values are equal.

Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func ==(lhs: Self, rhs: Self) -> Bool

Declared In

Equatable
func >(_:rhs:)

Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func >(lhs: Self, rhs: Self) -> Bool

Declared In

Comparable
func >=(_:rhs:)

Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func >=(lhs: Self, rhs: Self) -> Bool

Declared In

Comparable
func advanced(by:) Required

Returns a Self x such that self.distance(to: x) approximates n.

If Stride conforms to Integer, then self.distance(to: x) == n.

Complexity: O(1).

Declaration

func advanced(by n: Self.Stride) -> Self
func distance(to:) Required

Returns a stride x such that self.advanced(by: x) approximates other.

If Stride conforms to Integer, then self.advanced(by: x) == other.

Complexity: O(1).

Declaration

func distance(to other: Self) -> Self.Stride