[#bsl-map-0a7-insert-03] = xref:bsl.adoc[bsl]::xref:bsl/map-0a7.adoc[map]::insert :relfileprefix: ../../ :mrdocs: `insert` overloads == Synopses Declared in `<bslstl_map.h>` Insert a movable `value` if its key is absent. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[pair<map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>] xref:bsl/map-0a7/insert-07.adoc[insert](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<value_type>] value); ---- [.small]#xref:bsl/map-0a7/insert-07.adoc[_» more..._]# Insert elements from `values` whose keys are not already present. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/map-0a7/insert-0d.adoc[insert](std::initializer_list<value_type> values); ---- [.small]#xref:bsl/map-0a7/insert-0d.adoc[_» more..._]# Insert a copy of `value` if its key is absent. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[pair<map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>] xref:bsl/map-0a7/insert-000.adoc[insert](xref:bsl/map-0a7/value_type.adoc[value_type] const& value); ---- [.small]#xref:bsl/map-0a7/insert-000.adoc[_» more..._]# Insert an element constructed from `value` if its key is absent. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALT_VALUE_TYPE> xref:bsl/pair-0b.adoc[pair<iterator, bool>] xref:bsl/map-0a7/insert-029.adoc[insert](ALT_VALUE_TYPE&& value) requires std::is_constructible<value_type, ALT_VALUE_TYPE&&>::value; ---- [.small]#xref:bsl/map-0a7/insert-029.adoc[_» more..._]# Insert a movable `value` near `hint` if its key is absent. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0a7/iterator.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator] xref:bsl/map-0a7/insert-023.adoc[insert]( xref:bsl/map-0a7/const_iterator.adoc[const_iterator] hint, xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<value_type>] value); ---- [.small]#xref:bsl/map-0a7/insert-023.adoc[_» more..._]# Insert a copy of `value` near `hint` if its key is absent. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0a7/iterator.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator] xref:bsl/map-0a7/insert-08.adoc[insert]( xref:bsl/map-0a7/const_iterator.adoc[const_iterator] hint, xref:bsl/map-0a7/value_type.adoc[value_type] const& value); ---- [.small]#xref:bsl/map-0a7/insert-08.adoc[_» more..._]# Insert elements from `[first, last)]` whose keys are not already present. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> void xref:bsl/map-0a7/insert-01.adoc[insert]( INPUT_ITERATOR first, INPUT_ITERATOR last); ---- [.small]#xref:bsl/map-0a7/insert-01.adoc[_» more..._]# Insert a convertible `value` near `hint` if its key is absent. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALT_VALUE_TYPE> xref:bsl/map-0a7/iterator.adoc[iterator] xref:bsl/map-0a7/insert-005.adoc[insert]( xref:bsl/map-0a7/const_iterator.adoc[const_iterator] hint, ALT_VALUE_TYPE&& value) requires std::is_constructible<value_type, ALT_VALUE_TYPE&&>::value; ---- [.small]#xref:bsl/map-0a7/insert-005.adoc[_» more..._]# == Return Value * pair of iterator and whether a new element was inserted * iterator to the existing or newly inserted element == Parameters [cols="1,4"] |=== | Name| Description | *value* | element to move‐insert | *values* | initializer list of elements to insert | *hint* | iterator hint for the insertion position | *first* | beginning of the range to insert | *last* | end of the range to insert |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#