Documentation
¶
Overview ¶
Package set set.go
Index ¶
- type Set
- func (s Set[T]) Add(value T)
- func (s Set[T]) Clear()
- func (s Set[T]) Clone() Set[T]
- func (s Set[T]) Contains(value T) bool
- func (s Set[T]) Difference(other Set[T]) Set[T]
- func (s Set[T]) Intersection(other Set[T]) Set[T]
- func (s Set[T]) IsSubset(other Set[T]) bool
- func (s Set[T]) Map(values []T)
- func (s Set[T]) Remove(value T)
- func (s Set[T]) Size() int
- func (s Set[T]) Union(other Set[T]) Set[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
func NewSet ¶
func NewSet[T comparable](values ...T) Set[T]
NewSet creates a new set and initializes it with the provided values.
func (Set[T]) Difference ¶
Difference creates a new set that is the difference of two sets.
func (Set[T]) Intersection ¶
Intersection creates a new set that is the intersection of two sets.
Click to show internal directories.
Click to hide internal directories.