UnsafeHashMap.update

Looks up a key's entry in the table, then either updates it or creates a new one (may rehash).

  1. Value update(Key key, const(Create) create, const(Update) update, err_t error)
    struct UnsafeHashMap(Key, Value)
    nothrow
    Value
    update
    (
    Create
    Update
    )
    (
    Key key
    ,
    scope auto ref const(Create) create
    ,
    scope auto ref const(Update) update
    ,)
    if (
    is(ReturnType!Create == Value) &&
    Parameters!Create.length == 0
    &&
    is(ReturnType!Update == Value)
    &&
    Parameters!Update.length == 1
    &&
    is(Parameters!Update[0] == Value)
    )
  2. Value update(Key key, const(Create) create, const(Update) update)

Parameters

key Key

Key being looked up and stored in the table.

create const(Create)

Called to construct a new value if the key isn't in the table.

update const(Update)

Called to update the value of an entry, if it was found.

error err_t

Set to zero on success, non-zero otherwise.

Return Value

Type: Value

The entry's final value (or its .init in case of failure).