generic

package
v0.0.0-...-f3335f4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunGeneric

func RunGeneric()

Types

type Apple

type Apple[T int | string] interface {
	GetPrice(price T)
}

type FujiApple

type FujiApple struct {
	Name string
}

func (FujiApple) GetPrice

func (fujiApple FujiApple) GetPrice(price int)

type IFSlice

type IFSlice[T int | float32] []T

切片

type Queue

type Queue[T interface{}] struct {
	// contains filtered or unexported fields
}

func (*Queue[T]) Offer

func (queue *Queue[T]) Offer(element T)

入队列

func (*Queue[T]) Poll

func (queue *Queue[T]) Poll() (T, bool)

出队列 出参2:队列是否为空

func (*Queue[T]) Size

func (queue *Queue[T]) Size() int

队列元素个数

type Student

type Student[T int | string] struct {
	Code T
	Name string
}

Jump to

Keyboard shortcuts

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