Documentation
¶
Overview ¶
Package comparator provides types and functions related to comparing values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparator ¶
Comparator is a function type for comparing two values.
It must return
-1 if a is less than b, 0 if a equals b, 1 if a is greater than b.
func Reverse ¶
func Reverse[T any](cmp Comparator[T]) Comparator[T]
Reverse returns a new comparator that reverses cmp
Click to show internal directories.
Click to hide internal directories.