Map.put

Adds or updates a mapping from the specified key. Note that, if a new mapping was added (added outputs true), the returned slice may reference a previously removed value. If this is not desired, copy the desired initial value into the sliced buffer returned by remove().

  1. void[] put(K key, bool added)
  2. void[] put(K key)
    class Map(size_t V, K)
    void[]
    put
    (
    K key
    )
    out (val) { assert (val.length == V); }

Parameters

key K

key to add/update mapping for

Return Value

Type: void[]

an array slicing the value buffer mapped to by the specified key. The caller should set the value as desired.

Out: The returned array is never null and has the length V.

Meta