HashSet

Implements a hashset, either using collections.treemap or collections.linkedlist as a set for backend. Cannot be accessed directly, instead it can check whether an element is within it or not. Backend's foreach capability is exposed to iterate over hashcodes.

Constructors

this
this(R range)

Creates a HashSet from a compatible range.

Members

Aliases

Backend
alias Backend = TreeMap!(HashType, void, true, less)
Undocumented in source.
HashType
alias HashType = ReturnType!hashFunc
Undocumented in source.
remove
alias remove = removeByElem
Undocumented in source.

Functions

has
bool has(K key)

Returns true if the element exists within the set, false otherwise.

has
bool has(HashType key)

Returns true if the element exists within the set, false otherwise.

hasRange
size_t hasRange(R range)

Returns the amount of elements found in the set.

opBinary
HashSet!(K, hashFunc, less) opBinary(R rhs)

Set operators. Enables math operations on sets, like unions and intersections. Could work on ranges in general as long as they implement some basic functions, like iteration.

opBinaryRight
auto opBinaryRight(K key)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinaryRight
auto opBinaryRight(K key)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
HashSet!(K, hashFunc, less) opOpAssign(E value)

Set operators.

opOpAssign
HashSet!(K, hashFunc, less) opOpAssign(R range)

Set operators.

put
HashType put(K key)

Puts an item into the hash set, then returns the generated hashcode.

removeByElem
HashType removeByElem(K key)

Removes an element by match. Returns the hashcode if found, or uint.init if not.

removeByElem
HashType removeByElem(HashType key)

Removes an element by hashcode.

Meta