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>
std::pair<iterator, bool>
insert_or_assign(
    key_arg<K> const& 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

Name

Description

k

The key to insert or look up.

v

The value to assign.

Created with MrDocs