Documentation ¶
Overview ¶
Package constraint defines useful constraints that are not in the go builtin package
SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigOps ¶
type BigOps[T any] interface { Abs(T) T Add(T, T) T Cmp(T) int Mul(T, T) T Neg(T) T Quo(T, T) T Set(T) T SetInt64(int64) T SetUint64(uint64) T Sign() int String() string Sub(T, T) T }
BigOps is an interface that describes all the common methods of the provided go big types
type Cmp ¶
type Cmp[T any] interface { comparable // Returns <0 if this value < argument // 0 if this value = argument // >0 if this value > argument Cmp(T) int }
Cmp is a companion interface for Ordered Embeds comparable so that the Cmp interface can be a map key
type Complex ¶
type Complex interface { ~complex64 | ~complex128 }
Complex is copied from golang.org/x/exp/constraints#Complex
type Integer ¶
type Integer interface { SignedInteger | UnsignedInteger }
Integer is equivalent to golang.org/x/exp/constraints#Integer
type IntegerAndFloat ¶
IntegerAndFloat describes any signed or unsigned integer type and any float type
type Ordered ¶
type Ordered interface { Signed | UnsignedInteger | ~string }
Ordered is equivalent to golang.org/x/exp/constraints#Ordered
type Signed ¶
type Signed interface { SignedInteger | Float }
Signed differs from golang.org/x/exp/constraints#Signed - it includes Float
type SignedInteger ¶
SignedInteger is copied from golang.org/x/exp/constraints#Signed