generic

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: ISC Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max[T constraints.Ordered](a, b T) T

func Min

func Min[T constraints.Ordered](a, b T) T

Types

type CompareFunc

type CompareFunc[T any] func(T, T) int

CompareFunc is a function for comparing two values of the same type.

func NewCompareFunc

func NewCompareFunc[T constraints.Ordered]() CompareFunc[T]

NewCompareFunc creates a comparator function for standard Go types.

func NewInvertedCompareFunc added in v0.3.2

func NewInvertedCompareFunc[T constraints.Ordered]() CompareFunc[T]

NewInvertedCompareFunc creates an inverted comparator function for standard Go types.

type EqualFunc

type EqualFunc[T any] func(T, T) bool

EqualFunc is a function for checking equality of two values of the same type.

func NewEqualFunc

func NewEqualFunc[T comparable]() EqualFunc[T]

NewEqualFunc creates a comparator function for standard Go types.

Jump to

Keyboard shortcuts

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