[#absl-linked_hash_map-insert_or_assign-0c] = xref:absl.adoc[absl]::xref:absl/linked_hash_map.adoc[linked_hash_map]::insert_or_assign :relfileprefix: ../../ :mrdocs: `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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class K = xref:absl/linked_hash_map/key_type.adoc[key_type], class V = xref:absl/linked_hash_map/mapped_type.adoc[mapped_type]> std::pair<iterator, bool> xref:absl/linked_hash_map/insert_or_assign-05.adoc[insert_or_assign]( xref:absl/linked_hash_map.adoc[key_arg<K>] const& k, V const& v); ---- [.small]#xref:absl/linked_hash_map/insert_or_assign-05.adoc[_» more..._]# Inserts the given key/value, or assigns the value if the key exists. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class K = xref:absl/linked_hash_map/key_type.adoc[key_type], class V = xref:absl/linked_hash_map/mapped_type.adoc[mapped_type], V* = nullptr> std::pair<iterator, bool> xref:absl/linked_hash_map/insert_or_assign-0e.adoc[insert_or_assign]( xref:absl/linked_hash_map.adoc[key_arg<K>] const& k, V&& v); ---- [.small]#xref:absl/linked_hash_map/insert_or_assign-0e.adoc[_» more..._]# Inserts the given key/value, or assigns the value if the key exists. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class K = xref:absl/linked_hash_map/key_type.adoc[key_type], class V = xref:absl/linked_hash_map/mapped_type.adoc[mapped_type], K* = nullptr> std::pair<iterator, bool> xref:absl/linked_hash_map/insert_or_assign-0f.adoc[insert_or_assign]( xref:absl/linked_hash_map.adoc[key_arg<K>]&& k, V const& v); ---- [.small]#xref:absl/linked_hash_map/insert_or_assign-0f.adoc[_» more..._]# Inserts the given key/value, or assigns the value if the key exists. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class K = xref:absl/linked_hash_map/key_type.adoc[key_type], class V = xref:absl/linked_hash_map/mapped_type.adoc[mapped_type], K* = nullptr, V* = nullptr> std::pair<iterator, bool> xref:absl/linked_hash_map/insert_or_assign-02.adoc[insert_or_assign]( xref:absl/linked_hash_map.adoc[key_arg<K>]&& k, V&& v); ---- [.small]#xref:absl/linked_hash_map/insert_or_assign-02.adoc[_» more..._]# Inserts the given key/value, or assigns the value if the key exists, ignoring the position hint. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class K = xref:absl/linked_hash_map/key_type.adoc[key_type], class V = xref:absl/linked_hash_map/mapped_type.adoc[mapped_type]> xref:absl/linked_hash_map/iterator.adoc[iterator] xref:absl/linked_hash_map/insert_or_assign-03.adoc[insert_or_assign]( xref:absl/linked_hash_map/const_iterator.adoc[const_iterator] hint, xref:absl/linked_hash_map.adoc[key_arg<K>] const& k, V const& v); ---- [.small]#xref:absl/linked_hash_map/insert_or_assign-03.adoc[_» more..._]# Inserts the given key/value, or assigns the value if the key exists, ignoring the position hint. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class K = xref:absl/linked_hash_map/key_type.adoc[key_type], class V = xref:absl/linked_hash_map/mapped_type.adoc[mapped_type], V* = nullptr> xref:absl/linked_hash_map/iterator.adoc[iterator] xref:absl/linked_hash_map/insert_or_assign-09.adoc[insert_or_assign]( xref:absl/linked_hash_map/const_iterator.adoc[const_iterator] hint, xref:absl/linked_hash_map.adoc[key_arg<K>] const& k, V&& v); ---- [.small]#xref:absl/linked_hash_map/insert_or_assign-09.adoc[_» more..._]# Inserts the given key/value, or assigns the value if the key exists, ignoring the position hint. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class K = xref:absl/linked_hash_map/key_type.adoc[key_type], class V = xref:absl/linked_hash_map/mapped_type.adoc[mapped_type], K* = nullptr> xref:absl/linked_hash_map/iterator.adoc[iterator] xref:absl/linked_hash_map/insert_or_assign-04a.adoc[insert_or_assign]( xref:absl/linked_hash_map/const_iterator.adoc[const_iterator] hint, xref:absl/linked_hash_map.adoc[key_arg<K>]&& k, V const& v); ---- [.small]#xref:absl/linked_hash_map/insert_or_assign-04a.adoc[_» more..._]# Inserts the given key/value, or assigns the value if the key exists, ignoring the position hint. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class K = xref:absl/linked_hash_map/key_type.adoc[key_type], class V = xref:absl/linked_hash_map/mapped_type.adoc[mapped_type], K* = nullptr, V* = nullptr> xref:absl/linked_hash_map/iterator.adoc[iterator] xref:absl/linked_hash_map/insert_or_assign-047.adoc[insert_or_assign]( xref:absl/linked_hash_map/const_iterator.adoc[const_iterator] hint, xref:absl/linked_hash_map.adoc[key_arg<K>]&& k, V&& v); ---- [.small]#xref:absl/linked_hash_map/insert_or_assign-047.adoc[_» more..._]# == 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 [cols="1,4"] |=== | Name| Description | *k* | The key to insert or look up. | *v* | The value to assign. | *hint* | A position hint, which is ignored. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#