[#BloombergLP-bslalg-DequePrimitives-01-insertAndMoveToFront-0e] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/DequePrimitives-01.adoc[DequePrimitives]::insertAndMoveToFront :relfileprefix: ../../../ :mrdocs: Insert a source range, shifting existing elements toward the front. == Synopsis Declared in `<bslalg_dequeprimitives.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class FWD_ITER, class SENTINEL, class ALLOCATOR> static void insertAndMoveToFront( xref:BloombergLP/bslalg/DequePrimitives-01/Iterator.adoc[Iterator]* toBegin, xref:BloombergLP/bslalg/DequePrimitives-01/Iterator.adoc[Iterator] fromBegin, xref:BloombergLP/bslalg/DequePrimitives-01/Iterator.adoc[Iterator] position, FWD_ITER first, SENTINEL last, xref:BloombergLP/bslalg/DequePrimitives-01/size_type.adoc[size_type] numElements, ALLOCATOR allocator); ---- == Description Insert the specified `numElements` in the range `[first .. last)]` at the specified `position`, by moving the elements in the range `[fromBegin .. position)]` backward by `numElements` position. Pass the specified `allocator` to the copy constructor if appropriate. Load into the specified `toBegin` an iterator to the end of the data after insertion (i.e., `fromBegin ‐ numElements`). The behavior is undefined unless `fromBegin ‐ numElements` is a valid iterator (i.e., the block pointer array holds enough room before the `fromBefore` position to insert `numElements`). == Parameters [cols="1,4"] |=== | Name| Description | *toBegin* | loads the beginning iterator after insertion | *fromBegin* | current beginning of the deque | *position* | insertion position within the deque | *first* | beginning of the source range to insert | *last* | end of the source range to insert (one past the last) | *numElements* | number of elements in `[first .. last)]` | *allocator* | allocator passed to element constructors |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#