The OpenD Programming Language

TreeMap

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

Constructors

this
this()

No default construction if an allocator must be provided.

this
this(Allocator allocator)

Use the given allocator for allocations.

Postblit

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

Members

Aliases

opSlice
alias opSlice = byValue

Functions

back
auto back()
byKey
auto byKey()
byKeyValue
auto byKeyValue()
byValue
auto byValue()
containsKey
bool containsKey(K key)
empty
bool empty()
front
auto front()
get
auto get(K key, V defaultValue)
getOrAdd
auto getOrAdd(K key, V defaultValue)

If the given key does not exist in the TreeMap, adds it with the value defaultValue.

insert
void insert(K key, V value)

Inserts or overwrites the given key-value pair.

keys
auto keys()
length
size_t length()
opIndex
auto opIndex(K key)

Supports treeMapkey syntax.

opIndexAssign
void opIndexAssign(V value, K key)

Supports treeMapkey = value; syntax.

remove
bool remove(K key)

Removes the key→value mapping for the given key.

values
auto values()

Parameters

K

the key type

V

the value type

Allocator

the allocator to use. Defaults to Mallocator.

less

the key comparison function to use

supportGC

true to support storing GC-allocated objects, false otherwise

cacheLineSize

the size of the internal nodes in bytes

Meta