Constructs an element in place if the key is not present, ignoring the position hint.

Synopsis

Declared in <absl/container/linked_hash_map.h>

template<
    class K = key_type,
    class... Args,
    K* = nullptr>
iterator
try_emplace(
    const_iterator hint,
    key_arg<K>&& k,
    Args&&... args);

Return Value

An iterator to the inserted or existing element.

Parameters

Name

Description

k

The key to insert or look up.

args

The arguments used to construct the mapped value.

hint

A position hint, which is ignored.

Created with MrDocs