[#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 copies of a value, shifting existing elements toward the front&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 copies of a value toward the front (bitwise&hyphen;copyable)&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;] traits);
----

[.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;] traits);
----

[.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;] traits);
----

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

Insert a source range, shifting existing elements toward the front&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;_]#

== 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
| *numElements*
| number of copies of `value` to insert
| *value*
| value copied into each inserted element
| *allocator*
| allocator passed to element constructors
| *traits*
| unused trait tag for overload resolution
| *first*
| beginning of the source range to insert
| *last*
| end of the source range to insert (one past the last)
|===


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