Scatter Set
ScatterSet is a container with a Set-like interface based on a flat hash table implementation. The underlying implementation is designed to avoid all allocations on insertion, removal, retrieval, and iteration. Allocations may still happen on insertion when the underlying storage needs to grow to accommodate newly added elements to the set.
This implementation makes no guarantee as to the order of the elements, nor does it make guarantees that the order remains constant over time.
Though ScatterSet offers a read-only interface, it is always backed by a MutableScatterSet. Read operations alone are thread-safe. However, any mutations done through the backing MutableScatterSet while reading on another thread are not safe and the developer must protect the set from such changes during read operations.
Note: when a Set is absolutely necessary, you can use the method asSet to create a thin wrapper around a ScatterSet. Please refer to asSet for more details and caveats.
See also
Inheritors
Properties
Functions
Wraps this ScatterSet with a Set interface. The Set is backed by the ScatterSet, so changes to the ScatterSet are reflected in the Set. If the ScatterSet is modified while an iteration over the Set is in progress, the results of the iteration are undefined.
Returns true if this set is not empty.