constraints

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package constraints provides constraints for generic iterator helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloneable

type Cloneable[T any] interface {
	Clone() T
}

Cloneable is a type that can be cloned.

type ComparableByEqual

type ComparableByEqual[T any] interface {
	Equal(T) bool
}

ComparableByEqual is a type that can be compared by the Equal method.

type Float

type Float interface {
	~float32 | ~float64
}

Float is any floating-point type.

type Integer

type Integer interface {
	Signed | Unsigned
}

Integer is any integer type.

type Number

type Number interface {
	Integer | Float
}

Number is any number type.

type Ordered

type Ordered interface {
	Number | ~string
}

Ordered is any built-in type that can be ordered.

type OrderedByCompare

type OrderedByCompare[T any] interface {
	Compare(T) int
}

OrderedByCompare is a type that can be ordered by the Compare method.

type OrderedByLess

type OrderedByLess[T any] interface {
	Less(T) bool
}

OrderedByLess is a type that can be ordered by the Less method.

type Predicate

type Predicate[T any] interface {
	~func(T) bool
}

Predicate is a function that takes an argument of type T and returns a bool.

type Predicate2

type Predicate2[T1, T2 any] interface {
	~func(T1, T2) bool
}

Predicate2 is a function that takes arguments of type T1 and T2 and returns a bool.

type Signed

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

Signed is any signed integer type.

type Unsigned

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Unsigned is any unsigned integer type.

Jump to

Keyboard shortcuts

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