Documentation
¶
Index ¶
- func SortUniqItems[T constraints.Ordered](items []T) []T
- func Tern[T any](cond bool, v1, v2 T) T
- type Set
- func (ss Set[T]) Add(values ...T) Set[T]
- func (ss Set[T]) AddComplement(values ...T) []T
- func (ss Set[T]) Complement(values ...T) []T
- func (ss Set[T]) Del(values ...T) Set[T]
- func (ss Set[T]) Empty() bool
- func (ss Set[T]) Includes(v T) bool
- func (ss Set[T]) Len() int
- func (ss Set[T]) List() []T
- func (ss Set[T]) Sorted() []T
- func (ss Set[T]) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortUniqItems ¶
func SortUniqItems[T constraints.Ordered](items []T) []T
Types ¶
type Set ¶
type Set[T constraints.Ordered] map[T]bool
Set - set of items
func NewSet ¶
func NewSet[T constraints.Ordered](values ...T) Set[T]
func (Set[T]) AddComplement ¶
func (ss Set[T]) AddComplement(values ...T) []T
func (Set[T]) Complement ¶
func (ss Set[T]) Complement(values ...T) []T
Click to show internal directories.
Click to hide internal directories.