HashSet

A garbage collected implementation of a hash set.

Because this type is a struct, it can never be null.

Constructors

this
this(size_t minimumSize)

Construct a set reserving a minimum of :minimumSize: space for the bucket list. The actual space allocated may be some number larger than the requested size, but it will be enough to fit as many items as requested without another allocation.

Members

Aliases

put
alias put = add

A HashSet is an OutputRange.

Functions

add
void add(ref T value)
void add(T value)

Add an element to this set if needed.

dup
HashSet!T dup()
opBinaryRight
bool opBinaryRight(ref T value)
bool opBinaryRight(T value)

Provide the 'in' operator for sets.

opCast
bool opCast()

Implement boolean conversion for a set.

opEquals
bool opEquals(const(HashSet!U) otherSet)
remove
bool remove(ref T value)
bool remove(T value)

Remove an element from this set if present.

Properties

empty
bool empty [@property getter]
length
size_t length [@property getter]

Meta