[#BloombergLP-bslalg-DequePrimitives-01-insertAndMoveToFront-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/DequePrimitives-01.adoc[DequePrimitives]::insertAndMoveToFront
:relfileprefix: ../../../
:mrdocs:

`insertAndMoveToFront` overloads

== Synopses

Declared in `&lt;bslalg&lowbar;dequeprimitives&period;h&gt;`

Insert the specified `numElements` copies of the specified `value` at the specified `position`, by moving the elements in the range `&lsqb;fromBegin &period;&period; position)&rsqb;` backward by `numElements` position&period; Pass the specified `allocator` to the copy constructor if appropriate&period; Load into the specified `toBegin` an iterator to the beginning of the data after insertion (i&period;e&period;, `fromBegin &hyphen; numElements`)&period; The behavior is undefined unless `fromBegin &hyphen; numElements` is a valid iterator (i&period;e&period;, the block pointer array holds enough room before the `fromBegin` position to insert `numElements`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-08.adoc[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,
    xref:BloombergLP/bslalg/DequePrimitives-01/size_type.adoc[size&lowbar;type] numElements,
    VALUE&lowbar;TYPE const& value,
    ALLOCATOR allocator);
----

[.small]#xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-08.adoc[_» more&period;&period;&period;_]#

Insert the specified `numElements` copies of the specified `value` at the specified `position`, by moving the elements in the range `&lsqb;fromBegin &period;&period; position)&rsqb;` backward by `numElements` position&period; Pass the specified `allocator` to the copy constructor if appropriate&period; Load into the specified `toBegin` an iterator to the beginning of the data after insertion (i&period;e&period;, `fromBegin &hyphen; numElements`&period; The behavior is undefined unless `fromBegin &hyphen; numElements` is a valid iterator (i&period;e&period;, the block pointer array holds enough room before the `fromBegin` position to insert `numElements`)&period; Note that the last argument is for removing overload ambiguities and is not used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-05.adoc[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,
    xref:BloombergLP/bslalg/DequePrimitives-01/size_type.adoc[size&lowbar;type] numElements,
    VALUE&lowbar;TYPE const& value,
    ALLOCATOR allocator,
    xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;int, BSLALG&lowbar;DEQUEPRIMITIVES&lowbar;BITWISE&lowbar;COPYABLE&lowbar;TRAITS&gt;]);
----

[.small]#xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-05.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `insertAndMoveToFront`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-03.adoc[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,
    xref:BloombergLP/bslalg/DequePrimitives-01/size_type.adoc[size&lowbar;type] numElements,
    VALUE&lowbar;TYPE const& value,
    ALLOCATOR allocator,
    xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;int, BSLALG&lowbar;DEQUEPRIMITIVES&lowbar;BITWISE&lowbar;MOVEABLE&lowbar;TRAITS&gt;]);
----

[.small]#xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-03.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `insertAndMoveToFront`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-0d.adoc[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,
    xref:BloombergLP/bslalg/DequePrimitives-01/size_type.adoc[size&lowbar;type] numElements,
    VALUE&lowbar;TYPE const& value,
    ALLOCATOR allocator,
    xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;int, BSLALG&lowbar;DEQUEPRIMITIVES&lowbar;NIL&lowbar;TRAITS&gt;]);
----

[.small]#xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-0d.adoc[_» more&period;&period;&period;_]#

Insert the specified `numElements` in the range `&lsqb;first &period;&period; last)&rsqb;` at the specified `position`, by moving the elements in the range `&lsqb;fromBegin &period;&period; position)&rsqb;` backward by `numElements` position&period; Pass the specified `allocator` to the copy constructor if appropriate&period; Load into the specified `toBegin` an iterator to the end of the data after insertion (i&period;e&period;, `fromBegin &hyphen; numElements`)&period; The behavior is undefined unless `fromBegin &hyphen; numElements` is a valid iterator (i&period;e&period;, the block pointer array holds enough room before the `fromBefore` position to insert `numElements`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class FWD&lowbar;ITER,
    class SENTINEL,
    class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-0e.adoc[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&lowbar;ITER first,
    SENTINEL last,
    xref:BloombergLP/bslalg/DequePrimitives-01/size_type.adoc[size&lowbar;type] numElements,
    ALLOCATOR allocator);
----

[.small]#xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-0e.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
