TreeMap

A key→value mapping where the keys are guaranteed to be sorted.

struct TreeMap (
K
V
Allocator = Mallocator
alias less = "a < b"
bool supportGC =
shouldAddGCRange!K ||
shouldAddGCRange!V
size_t cacheLineSize = 64
) {
TreeType tree;
TreeType tree;
}

Disabled Default Constructor

A disabled default is present on this object. To use it, use one of the other constructors or a factory function.

Constructors

this
this(Allocator allocator)

Use the given allocator for allocations.

Postblit

Copying this object is disabled.

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

Members

Aliases

opIndexAssign
alias opIndexAssign = insert

Supports treeMapkey = value; syntax.

Functions

containsKey
bool containsKey(K key)
empty
bool empty()
insert
void insert(V value, K key)

Inserts the given key-value pair.

length
size_t length()
opApply
int opApply(int delegate(ref K, ref V) loopBody)

Supports foreach(k, v; treeMap) syntax.

opIndex
auto opIndex(K key)

Supports treeMapkey syntax.

remove
bool remove(K key)

Removes the key→value mapping for the given key.

Meta