DoxigAlpha

put

Insert an entry if the associated key is not already present, otherwise update preexisting value.

Function parameters

Parameters

#
self:*Self
key:K
value:V

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
StringHashMap
Builtin hashmap for strings as keys.
StringHashMapUnmanaged
Key memory is managed by the caller.
HashMap
General purpose hash table.
HashMapUnmanaged
A HashMap based on open addressing and linear probing.

= 80

Values

#

Source

Implementation

#
pub fn put(self: *Self, allocator: Allocator, key: K, value: V) Allocator.Error!void {
    if (@sizeOf(Context) != 0)
        @compileError("Cannot infer context " ++ @typeName(Context) ++ ", call putContext instead.");
    return self.putContext(allocator, key, value, undefined);
}