comparator

package
v0.0.0-...-bc262a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparator

type Comparator[T any] interface {
	Less(a, b T) bool // returns true if a < b, false otherwise
}

type CustomComparator

type CustomComparator[T any] struct {
	// contains filtered or unexported fields
}

func Custom

func Custom[T any](customLess func(a, b T) bool) CustomComparator[T]

func (CustomComparator[T]) Less

func (cc CustomComparator[T]) Less(a, b T) bool

type Greater

type Greater[T cmp.Ordered] struct{}

func (Greater[T]) Less

func (l Greater[T]) Less(a, b T) bool

type Less

type Less[T cmp.Ordered] struct{}

Predefined comparators

func (Less[T]) Less

func (l Less[T]) Less(a, b T) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL