The OpenD Programming Language

OpenHashSet

Simple open-addressed hash set that uses linear probing to resolve sollisions.

Constructors

this
this(Allocator allocator)

Use the given allocator for allocations.

this
this(size_t initialCapacity, Allocator allocator)

Initializes the hash set with the given initial capacity.

this
this(size_t initialCapacity)

Initializes the hash set with the given initial capacity.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Postblit

this(this)
this(this)

Disallow copy construction

Members

Aliases

insertAnywhere
alias insertAnywhere = insert
put
alias put = insert

Inserts the given item into the set.

Functions

clear
void clear()

Removes all items from the hash set.

contains
bool contains(T item)
empty
bool empty()
insert
bool insert(T item)

Inserts the given item into the set.

length
size_t length()
opBinaryRight
bool opBinaryRight(T item)
opOpAssign
bool opOpAssign(T item)

Inserts the given item into the set.

opSlice
auto opSlice()
remove
bool remove(T item)

Parameters

T

the element type of the hash set

Allocator

the allocator to use. Defaults to Mallocator.

hashFunction

the hash function to use

supportGC

if true, calls to GC.addRange and GC.removeRange will be used to ensure that the GC does not accidentally free memory owned by this container.

Meta