Cbeam
|
Updates an existing entry in the map or inserts a new one if the key does not exist.
Updates an existing entry in the map or inserts a new one if the key does not exist.This method abstracts the common pattern of checking for an existing key, updating its value if present, or inserting a new key-value pair if the key is not found. The method handles locking, deserialization, and serialization of the map internally.
key | The key to update or insert. |
updater | A function that updates the value associated with the key. It takes a reference to the value type. |
default_value | The default value to insert if the key is not found in the map. |