LinkedHashSet

Implements linked hashset with a linked set as a backend. Uses an equal method for comparison, meaning it can use complex keys. Has poorer access times compared to the hashset with a binary search tree as a backend, but less costly insertion. Elements 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 LinkedHashSet from a compatible range.

Members

Aliases

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.

moveFront
HashType moveFront()

Returns the element at begin and increments the position by one.

opBinary
LinkedHashSet!(K, hashFunc, equal) 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(HashType key)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
LinkedHashSet!(K, hashFunc, equal) opOpAssign(E value)

Set operators.

opOpAssign
LinkedHashSet!(K, hashFunc, equal) opOpAssign(R range)

Set operators.

popFront
void popFront()

Increments the front iteration position by one

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.

Properties

empty
bool empty [@property getter]

Returns true when the end of the list have been reached.

front
HashType front [@property getter]

Returns the element at the front.

save
auto save [@property getter]

Returns a copy of this struct.

Static variables

nogcIndexing
enum bool nogcIndexing;
Undocumented in source.

Meta