Structureswift 6.0.1FoundationEssentials
ComparableComparator
Compares Comparable
types using their comparable implementation.
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
struct ComparableComparator<Compared> where Compared : Comparable
Compares Comparable
types using their comparable implementation.
struct ComparableComparator<Compared> where Compared : Comparable
import FoundationEssentials
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
@preconcurrency protocol SortComparator<Compared> : Hashable, Sendable
A comparison algorithm for a given type.
init(order: SortOrder = .forward)
var order: SortOrder
func compare(_ lhs: Compared, _ rhs: Compared) -> ComparisonResult
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.