order

package
v0.0.0-...-ae1ba64 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Natural

func Natural[T Ordered](t1, t2 T) int

func Reversed

func Reversed[T Ordered](t1, t2 T) int

Types

type Comparator

type Comparator[T any] funcs.BiFunction[T, T, int]

Comparator 比较两个元素. 第一个元素大于第二个元素时,返回正数; 第一个元素小于第二个元素时,返回负数; 否则返回 0.

func Reverse

func Reverse[T Ordered](cmp Comparator[T]) Comparator[T]

type Ordered

type Ordered interface {
	nums.Number | ~string
}

Jump to

Keyboard shortcuts

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