update
fn
void update(K, V, C, U)(ref V[K] aa, K key, scope C create, scope U update) if (is(typeof(create()) : V) && (is(typeof(update(aa[K.init])) : V) || is(typeof(update(aa[K.init])) == void)))Calls create if key doesn't exist in the associative array, otherwise calls update. create returns a corresponding value for key. update accepts a value parameter. If it returns a value, the value is set for key.
Parameters
aa | The associative array. |
key | The key. |
create | The callable to create a value for key. Must return V. |
update | The callable to call if key exists. Takes a V argument, returns a V or void. |