Required Associated Typeswift 6.0.1FoundationEssentials
Compared
The type that the SortComparator
provides a comparison for.
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
associatedtype Compared
The type that the SortComparator
provides a comparison for.
associatedtype Compared
import FoundationEssentials
@preconcurrency protocol SortComparator<Compared> : Hashable, Sendable
A comparison algorithm for a given type.
var order: SortOrder { get set }
If the SortComparator
s resulting order is forward or reverse.
func compare(_ lhs: Self.Compared, _ rhs: Self.Compared) -> ComparisonResult
The relative ordering of lhs, and rhs.