Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStringComparer ¶
func NewStringComparer() *stringComparer
Creates new comparer that works withs strings.
Types ¶
type Comparer ¶
type Comparer[T any] interface { // Returns // -1 if a > b // 0 if a = b // 1 if a < b Compare(a, b T) int }
Comparer provides a way to compare 2 elements.
type ComparerFunc ¶
ComparerFunc lets create sateless comparer in short way.
func (ComparerFunc[T]) Compare ¶
func (cf ComparerFunc[T]) Compare(a, b T) int
Click to show internal directories.
Click to hide internal directories.