Documentation
¶
Overview ¶
Package constraints provides constraints for type parameters aka. generics in Go.
This is a more comprehensive drop-in replacement for golang.org/x/exp/constraints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparable ¶
type Comparable interface { comparable }
Comparable is a constraint that matches any type that can be compared with the == and != operators.
type Complex ¶
type Complex interface { ~complex64 | ~complex128 }
Complex is a constraint that matches any complex number type.
type Number ¶
Number is a constraint that matches any real number type. The Number constraint does not include Complex numbers, as those are not ordered. If you also need Complex numbers, use the Numeric constraint.
type Orderable ¶
Orderable is a constraint that matches any type that can be ordered with the <, <=, >, and >= operators.