absl::linked_hash_map::try_emplace

Constructs an element in place if the key is not already present.

Synopsis

Declared in <absl/container/linked_hash_map.h>

template<
    class K = key_type,
    typename... Args>
std::pair<iterator, bool>
try_emplace(
    key_arg<K> const& key,
    Args&&... args);

Return Value

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

Parameters

NameDescription
keyThe key to insert or look up.
argsThe arguments used to construct the mapped value.