Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Set represents a set. It is implemented as a thin wrapper over a map with a zero sized value.
func FromValues ¶
func FromValues[T comparable](values []T) Set[T]
FromValues creates a new set from the given values. If the provided values contain duplicates, the set will only contain one of instance of each value.
func WithCapacity ¶
func WithCapacity[T comparable](cap int) Set[T]
WithCapacity creates a new set with the given capacity.
func (*Set[T]) Add ¶
Add adds the given value to the set. Returns true, iff the value was not part of the set and was actually added.