The OpenD Programming Language

TreeMap.getOrAdd

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

struct TreeMap(K, V, Allocator = Mallocator, alias less = "a < b", bool supportGC = shouldAddGCRange!K || shouldAddGCRange!V, size_t cacheLineSize = 64)
getOrAdd
(
this This
)
(
const K key
,)

Parameters

key K

the key to look up

defaultValue V

the default value

Return Value

Type: auto

A pointer to the existing value, or a pointer to the inserted value.

Meta