constraints

package
v0.0.2-0...-11de152 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: BSD-2-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adder

type Adder[T any] interface {
	Add(T) T
}

type FloatComplex

type FloatComplex interface {
	~float32 | ~float64 | ~complex64 | ~complex128
}

type Integer

type Integer interface {
	~int8 | ~int16 | ~int32 | ~int64 | ~int |
		~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uint
}

type Ordered

type Ordered interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 |
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
		~float32 | ~float64 |
		~string
}

Ordered is a type constraint that matches all ordered types. (An ordered type is one that supports the < <= >= > operators.) In practice this type constraint would likely be defined in a standard library package.

type Pair

type Pair[F1, F2 any] struct {
	// contains filtered or unexported fields
}

type PrintableStringer

type PrintableStringer[T Stringer] interface {
	Print()
}

type Sequence

type Sequence interface {
	~string | ~[]byte
}

type Signed

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

type Stringer

type Stringer interface {
	String() string
}

An interface specifies methods and types for each of the type parameters it constrains.

type Unsigned

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

Jump to

Keyboard shortcuts

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