[#bsl-list-054-insert-0a5] = xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::insert :relfileprefix: ../../ :mrdocs: `insert` overloads == Synopses Declared in `<bslstl_list.h>` Insert the move‐insertable `value` at `dstPosition`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/iterator.adoc[list<VALUE, ALLOCATOR>::iterator] xref:bsl/list-054/insert-0c.adoc[insert]( xref:bsl/list-054/const_iterator.adoc[const_iterator] dstPosition, xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<value_type>] value); ---- [.small]#xref:bsl/list-054/insert-0c.adoc[_» more..._]# Insert the values from `values` at the specified `dstPosition`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/iterator.adoc[list<VALUE, ALLOCATOR>::iterator] xref:bsl/list-054/insert-00.adoc[insert]( xref:bsl/list-054/const_iterator.adoc[const_iterator] dstPosition, std::initializer_list<value_type> values); ---- [.small]#xref:bsl/list-054/insert-00.adoc[_» more..._]# Insert a copy of `value` at `dstPosition` and return an iterator to it. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/iterator.adoc[list<VALUE, ALLOCATOR>::iterator] xref:bsl/list-054/insert-06.adoc[insert]( xref:bsl/list-054/const_iterator.adoc[const_iterator] dstPosition, xref:bsl/list-054/value_type.adoc[value_type] const& value); ---- [.small]#xref:bsl/list-054/insert-06.adoc[_» more..._]# Insert `numElements` copies of `value` at `dstPosition`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/iterator.adoc[list<VALUE, ALLOCATOR>::iterator] xref:bsl/list-054/insert-0ab.adoc[insert]( xref:bsl/list-054/const_iterator.adoc[const_iterator] dstPosition, xref:bsl/list-054/size_type.adoc[size_type] numElements, xref:bsl/list-054/value_type.adoc[value_type] const& value); ---- [.small]#xref:bsl/list-054/insert-0ab.adoc[_» more..._]# Insert the values in `[first .. last)]` at the specified `dstPosition`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/list-054/iterator.adoc[iterator] xref:bsl/list-054/insert-0e.adoc[insert]( xref:bsl/list-054/const_iterator.adoc[const_iterator] dstPosition, INPUT_ITERATOR first, INPUT_ITERATOR last) requires !is_arithmetic<INPUT_ITERATOR>::value && !is_enum<INPUT_ITERATOR>::value; ---- [.small]#xref:bsl/list-054/insert-0e.adoc[_» more..._]# == Return Value * iterator to the newly inserted element * iterator to the first inserted element, or `dstPosition` if empty == Parameters [cols="1,4"] |=== | Name| Description | *dstPosition* | location before which the element is inserted | *value* | element to move‐insert | *values* | initializer list of values to insert | *numElements* | number of copies of `value` to insert | *first* | start of the iterator range | *last* | one past the end of the iterator range |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#