insert_or_assign overloads

Synopses

Declared in <absl/container/linked_hash_map.h>

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

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

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

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

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

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);

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

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

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

template<
    class K = key_type,
    class V = mapped_type>
iterator
insert_or_assign(
    const_iterator hint,
    key_arg<K> const& k,
    V const& v);

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

template<
    class K = key_type,
    class V = mapped_type,
    V* = nullptr>
iterator
insert_or_assign(
    const_iterator hint,
    key_arg<K> const& k,
    V&& v);

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

template<
    class K = key_type,
    class V = mapped_type,
    K* = nullptr>
iterator
insert_or_assign(
    const_iterator hint,
    key_arg<K>&& k,
    V const& v);

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

template<
    class K = key_type,
    class V = mapped_type,
    K* = nullptr,
    V* = nullptr>
iterator
insert_or_assign(
    const_iterator hint,
    key_arg<K>&& k,
    V&& v);

Return Value

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

  • An iterator to the inserted or updated element.

Parameters

Name

Description

k

The key to insert or look up.

v

The value to assign.

hint

A position hint, which is ignored.

Created with MrDocs