util

package
v0.0.0-...-4a4f425 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortedInsert

func SortedInsert[E constraints.Ordered, S ~[]E](s S, e E) S

func SortedInsertFunc

func SortedInsertFunc[E any, S ~[]E](s S, e E, cmp func(E, E) int) S

func SortedKeys

func SortedKeys[K OrderedKey, V any, M ~map[K]V](m M) []K

Types

type OrderedKey

type OrderedKey interface {
	comparable
	constraints.Ordered
}

type Set

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

func (*Set[T]) Add

func (s *Set[T]) Add(v T) bool

func (*Set[T]) AddSet

func (s *Set[T]) AddSet(s2 Set[T]) bool

func (Set[T]) Contains

func (s Set[T]) Contains(v T) bool

func (Set[T]) Do

func (s Set[T]) Do(f func(T))

func (Set[T]) Len

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

func (*Set[T]) Remove

func (s *Set[T]) Remove(v T)

func (Set[T]) Slice

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

Jump to

Keyboard shortcuts

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