HashMap.getOrAdd

get value from hash or add if key is not in table. defaultValue can be callable.

struct HashMap(K, V, Allocator = Mallocator, bool GCRangesAllowed = true)
ref
V
getOrAdd
@safe
(
T
)

Return Value

Type: V

ref to value (maybe added)

Meta