[#bsl-deque-0c-insert-07] = xref:bsl.adoc[bsl]::xref:bsl/deque-0c.adoc[deque]::insert :relfileprefix: ../../ :mrdocs: `insert` overloads == Synopses Declared in `<bslstl_deque.h>` Insert at the specified `position` in this deque the specified move‐insertable `value`, and return an iterator providing modifiable access to the newly inserted element. `value` is left in a valid but unspecified state. If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of `value_type`), this method has no effect. This method requires that the (template parameter) `VALUE_TYPE` be `move‐insertable` into this deque (see {Requirements on `VALUE_TYPE`}). The behavior is undefined unless `position` is an iterator in the range `[cbegin() .. cend()]` (both endpoints included). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/deque-0c/iterator-02.adoc[deque<VALUE_TYPE, ALLOCATOR>::iterator] xref:bsl/deque-0c/insert-0c.adoc[insert]( xref:bsl/deque-0c/const_iterator.adoc[const_iterator] position, xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<value_type>] value); ---- [.small]#xref:bsl/deque-0c/insert-0c.adoc[_» more..._]# Insert at the specified `position` in this deque the value of each `value_type` object in the specified `values` initializer list, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. This method offers full guarantee of rollback in case an exception is thrown other than by the `VALUE_TYPE` copy constructor or assignment operator. This method requires that the (template parameter) `VALUE_TYPE` be `copy‐insertable` into this deque (see {Requirements on `VALUE_TYPE`}). The behavior is undefined unless `position` is an iterator in the range `[cbegin() .. cend()]` (both endpoints included). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/deque-0c/iterator-02.adoc[deque<VALUE_TYPE, ALLOCATOR>::iterator] xref:bsl/deque-0c/insert-00.adoc[insert]( xref:bsl/deque-0c/const_iterator.adoc[const_iterator] position, std::initializer_list<value_type> values); ---- [.small]#xref:bsl/deque-0c/insert-00.adoc[_» more..._]# Insert at the specified `position` in this deque a copy of the specified `value`, and return an iterator providing modifiable access to the newly inserted element. This method offers full guarantee of rollback in case an exception is thrown other than by the `VALUE_TYPE` copy constructor or assignment operator. This method requires that the (template parameter) `VALUE_TYPE` be `copy‐insertable` into this deque (see {Requirements on `VALUE_TYPE`}). The behavior is undefined unless `position` is an iterator in the range `[cbegin() .. cend()]` (both endpoints included). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/deque-0c/iterator-02.adoc[deque<VALUE_TYPE, ALLOCATOR>::iterator] xref:bsl/deque-0c/insert-08.adoc[insert]( xref:bsl/deque-0c/const_iterator.adoc[const_iterator] position, VALUE_TYPE const& value); ---- [.small]#xref:bsl/deque-0c/insert-08.adoc[_» more..._]# Insert at the specified `position` in this deque the specified `numElements` copies of the specified `value`, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. This method offers full guarantee of rollback in case an exception is thrown other than by the `VALUE_TYPE` copy constructor or assignment operator. This method requires that the (template parameter) `VALUE_TYPE` be `copy‐insertable` into this deque (see {Requirements on `VALUE_TYPE`}). The behavior is undefined unless `position` is an iterator in the range `[cbegin() .. cend()]` (both endpoints included). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/deque-0c/iterator-02.adoc[deque<VALUE_TYPE, ALLOCATOR>::iterator] xref:bsl/deque-0c/insert-02.adoc[insert]( xref:bsl/deque-0c/const_iterator.adoc[const_iterator] position, xref:bsl/deque-0c/size_type.adoc[size_type] numElements, VALUE_TYPE const& value); ---- [.small]#xref:bsl/deque-0c/insert-02.adoc[_» more..._]# Insert at the specified `position` in this deque the values in the range starting at the specified `first` and ending immediately before the specified `last` iterators of the (template parameter) type `INPUT_ITERATOR`, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. This method offers full guarantee of rollback in case an exception is thrown other than by the `VALUE_TYPE` copy constructor or assignment operator. The (template parameter) type `INPUT_ITERATOR` shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators]providing access to values of a type convertible to `value_type`, and `value_type` must be `emplace‐constructible` from `*i` into this deque, where `i` is a dereferenceable iterator in the range `[first .. last)]` (see {Requirements on `VALUE_TYPE`}). The behavior is undefined unless `position` is an iterator in the range `[cbegin() .. cend()]` (both endpoints included), and `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/deque-0c/iterator-02.adoc[deque<VALUE_TYPE, ALLOCATOR>::iterator] xref:bsl/deque-0c/insert-0f.adoc[insert]( xref:bsl/deque-0c/const_iterator.adoc[const_iterator] position, INPUT_ITERATOR first, INPUT_ITERATOR last); ---- [.small]#xref:bsl/deque-0c/insert-0f.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#