ch2

package
v0.0.0-...-6eb9459 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func I0_1

func I0_1[K interface{ io.Reader }]()

func I10

func I10[K interface{ io.Reader }]()

func I11

func I11[K interface {
	io.Reader
	io.Writer
}]()

func I14

func I14[K interface {
	any | os.File
}]()

func I15

func I15[K interface {
	comparable
}]()

func I16

func I16[K interface {
	error
	comparable
}]()

func I5

func I5[K any, V interface{ int | MyInt }]()

func I7

func I7[K any, V interface{ int | any }]()

func I9

func I9[K any, V interface{ int | I8 }]()

func Scale

func Scale[E constraints.Integer](s []E, c E) []E

func Scale1

func Scale1[S ~[]E, E constraints.Integer](s S, c E) S

Scale returns a copy of s with each element multiplied by c.

func ScaleAndPrint

func ScaleAndPrint(p Point)

func Stringify

func Stringify[T fmt.Stringer](s []T) (ret []string)

func Stringify2

func Stringify2[T fmt.Stringer](s []T) (ret []string)

func TestB

func TestB()

func TestFoo

func TestFoo()

func TestStringify

func TestStringify()

func Zero1

func Zero1[T any]() T

func Zero2

func Zero2[T any]() T

func Zero3

func Zero3[T any]() (t T)

func ZeroValue1

func ZeroValue1(v any) bool

Types

type A

type A[T any] struct {
	V T
}

func (*A[T]) Value

func (a *A[T]) Value() T

type Animal

type Animal[T any] struct {
	Val T
}

type C

type C struct{}

type CC

type CC[T any] A[T]

type C A

type Chan

type Chan[T any] chan T

type Error

type Error struct {
	Code  int
	Error string
}

底层类型不能是struct InvalidUnion

type Error2

type Error2 = struct {
	Code  int
	Error string
}

type Foo

type Foo[T any] []T

type Func

type Func[T any] func() T

type Heap

type Heap[T cmp.Ordered] []T

func (Heap[_]) Len

func (h Heap[_]) Len() int

func (Heap[_]) Less

func (h Heap[_]) Less(i, j int) bool

func (*Heap[T]) Pop

func (h *Heap[T]) Pop() T

func (*Heap[T]) Push

func (h *Heap[T]) Push(x T)

func (Heap[_]) Swap

func (h Heap[_]) Swap(i, j int)

type I00

type I00 interface {
	~Error2
}

type I000

type I000 interface {
	~[]byte
	~struct {
		// contains filtered or unexported fields
	}
}

type I8

type I8 interface {
	~int
}

type Int1

type Int1 interface {
	int16 | int32 | int64
}

type Int2

type Int2 interface {
	int16 | int32 | int64
}

type Int3

type Int3 interface {
	int16 | int32
}

type IntStr

type IntStr interface {
	int | string
}

type List

type List[T any] []T

type ListElement

type ListElement[T any] struct {
	// contains filtered or unexported fields
}

type ListHead

type ListHead[T any] struct {
	// contains filtered or unexported fields
}

type Map

type Map[K comparable, V any] map[K]V

type MyInt

type MyInt int

type MyInt2

type MyInt2 = int

type P

type P struct{}

type Point

type Point []int32

func (Point) String

func (p Point) String() string

type TT2

type TT2[P interface{ *C }] struct{}

type TT3

type TT3[P interface{ C }] struct{}

type TenItems

type TenItems[T any] [10]T

type Tree

type Tree[T any] struct {
	Left  *Tree[T]
	V     Value[T, int]
	Right *Tree[T]
}

type Value

type Value[T any, V any] struct {
	Hodler *Tree[T]
	Value  V
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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