absl::linked_hash_map::insert_or_assign

Inserts the given key/value, or assigns the value if the key exists.

Synopsis

Declared in <absl/container/linked_hash_map.h>

template<
    class K = key_type,
    class V = mapped_type,
    K* = nullptr>
std::pair<iterator, bool>
insert_or_assign(
    key_arg<K>&& k,
    V const& v);

Return Value

A pair of an iterator to the element and a bool that is true if insertion took place.

Parameters

NameDescription
kThe key to insert or look up.
vThe value to assign.