set

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 any ordered type. An ordered type is one that supports the <, <=, >, and >= operators.

type Set

type Set[T Ordered] struct {
	// contains filtered or unexported fields
}

Set 是一个*有序的*,非空的,不重复的 string 元素的集合。

func NewSet

func NewSet[T Ordered]() *Set[T]

func (*Set[T]) Append

func (s *Set[T]) Append(vals ...T) *Set[T]

func (*Set[T]) Has

func (s *Set[T]) Has(value T) bool

func (*Set[T]) Len

func (s *Set[T]) Len() int

func (*Set[T]) Remove added in v1.21.3

func (s *Set[T]) Remove(elems ...T) *Set[T]

func (*Set[T]) Slice

func (s *Set[T]) Slice() (r []T)

Jump to

Keyboard shortcuts

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