protocol
Strideable
Inheritance |
Comparable, Equatable
View Protocol Hierarchy →
|
---|---|
Associated Types |
A type that represents the distance between two values of |
Import |
|
Instance Methods
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
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
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
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
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
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
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
5 inherited items hidden. (Show all)
Conforming types are notionally continuous, one-dimensional values that can be offset and measured.