pub fn getOrPut(self: *Self, gpa: Allocator, key: K) Oom!GetOrPutResult 300
301
302
303
304 pub fn getOrPut(self: *Self, gpa: Allocator, key: K) Oom!GetOrPutResult {
if (@sizeOf(Context) != 0)
@compileError("Cannot infer context " ++ @typeName(Context) ++ ", call getOrPutContext instead.");
return self.getOrPutContext(gpa, key, undefined);
}
If key exists this function cannot fail. If there is an existing item with
key, then the resultEntrypointer points to it, and found_existing is true. Otherwise, puts a new item with undefined value, and theEntrypointer points to it. Caller should then initialize the value (but not the key).