Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Multi ¶
type Multi[T comparable] []*Set[T]
Multi combines multiple sets and treats them as a single set
func NewMulti ¶
func NewMulti[T comparable](ts ...*Set[T]) Multi[T]
NewMulti is a helper that infers type when creating a Multi
func (Multi[T]) AllContain ¶
AllContain returns true if every Set in Multi contains t. The slice is checked in order under the assumption that the slice is sorted from smallest to largest.
func (Multi[T]) Contains ¶
Contains returns true if any Set in Multi contains t. The slice is checked in reverse order under the assumption that the slice is sorted from smallest to largest.
func (Multi[T]) Intersection ¶
Intersection returns a set containing any value present in all sets.
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Set can contain values
func New ¶
func New[T comparable](elements ...T) *Set[T]
New creates a set containing the provided values.
Click to show internal directories.
Click to hide internal directories.