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

This `struct` provides a namespace for a suite of utility functions that operate on deques parameterized by the `VALUE&lowbar;TYPE` and `BLOCK&lowbar;LENGTH`&period; Depending on the traits of `VALUE&lowbar;TYPE`, the default and copy constructors, destructor, assignment operators, etcetera may not be invoked, and instead the operation can be optimized using a no&hyphen;op, bitwise move, or bitwise copy&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE&lowbar;TYPE,
    int BLOCK&lowbar;LENGTH&gt;
struct DequePrimitives;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/DequePrimitives-01/Iterator.adoc[`Iterator`] 
| This `typedef` is an alias for a deque iterator&period;
| xref:BloombergLP/bslalg/DequePrimitives-01/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias for `size&lowbar;type`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/DequePrimitives-01/destruct-0e.adoc[`destruct`] 
| `destruct` overloads
| xref:BloombergLP/bslalg/DequePrimitives-01/emplaceAndMoveToBack.adoc[`emplaceAndMoveToBack`] 
| Insert at the specified `position` a newly created `VALUE&lowbar;TYPE` object, constructed by forwarding the specified `allocator` (if required) and the specified (variable number of) `arguments` to the corresponding constructor of `VALUE&lowbar;TYPE`, and move the elements in the range `&lsqb;position &period;&period; fromEnd)&rsqb;` forward by 1 position&period; Load into the specified `toEnd` an iterator one past the inserted element (i&period;e&period;, `fromEnd &plus; 1`)&period; The behavior is undefined unless `fromEnd &plus; 1` is a valid iterator (i&period;e&period;, the block pointer array holds enough room after the `fromEnd` position to insert 1 element)&period;
| xref:BloombergLP/bslalg/DequePrimitives-01/emplaceAndMoveToBackDispatch-0e.adoc[`emplaceAndMoveToBackDispatch`] 
| `emplaceAndMoveToBackDispatch` overloads
| xref:BloombergLP/bslalg/DequePrimitives-01/emplaceAndMoveToFront.adoc[`emplaceAndMoveToFront`] 
| Insert at the specified `position` a newly created `VALUE&lowbar;TYPE` object, constructed by forwarding the specified `allocator` (if required) and the specified (variable number of) `arguments` to the corresponding constructor of `VALUE&lowbar;TYPE`, and move the elements in the range `&lsqb;fromBegin &period;&period; position)&rsqb;` backward by 1 position&period; Load into the specified `toBegin` an iterator to the inserted element (i&period;e&period;, `fromBegin &hyphen; 1`)&period; The behavior is undefined unless `fromBegin &hyphen; 1` is a valid iterator (i&period;e&period;, the block pointer array holds enough room before the `fromBegin` position to insert 1 element)&period;
| xref:BloombergLP/bslalg/DequePrimitives-01/emplaceAndMoveToFrontDispatch-08.adoc[`emplaceAndMoveToFrontDispatch`] 
| `emplaceAndMoveToFrontDispatch` overloads
| xref:BloombergLP/bslalg/DequePrimitives-01/erase-0c.adoc[`erase`] 
| `erase` overloads
| xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToBack-0d.adoc[`insertAndMoveToBack`] 
| `insertAndMoveToBack` overloads
| xref:BloombergLP/bslalg/DequePrimitives-01/insertAndMoveToFront-00.adoc[`insertAndMoveToFront`] 
| `insertAndMoveToFront` overloads
| xref:BloombergLP/bslalg/DequePrimitives-01/moveBack.adoc[`moveBack`] 
| Move the specified `numElements` from the specified `source` to the specified `destination` using `std&colon;&colon;memmove`&period; Also load into `destination` the value `destination &hyphen; numElements` and `source` the value `source &hyphen; numElements`&period; The behavior is undefined unless `destination &gt;&equals; source`&period;
| xref:BloombergLP/bslalg/DequePrimitives-01/moveFront.adoc[`moveFront`] 
| Move the specified `numElements` from the specified `source` to the specified `destination` using `std&colon;&colon;memmove`&period; Also load into `destination` the value `destination &plus; numElements` and `source` the the value `source &plus; numElements`&period; The behavior is undefined unless `destination &lt;&equals; source`&period;
| xref:BloombergLP/bslalg/DequePrimitives-01/moveInsertAndMoveToBack-0f.adoc[`moveInsertAndMoveToBack`] 
| `moveInsertAndMoveToBack` overloads
| xref:BloombergLP/bslalg/DequePrimitives-01/moveInsertAndMoveToFront-00.adoc[`moveInsertAndMoveToFront`] 
| `moveInsertAndMoveToFront` overloads
| xref:BloombergLP/bslalg/DequePrimitives-01/uninitializedFillNBack.adoc[`uninitializedFillNBack`] 
| Append the specified `numElements` copies of the specified `value` to the deque ending at the specified `fromEnd` iterator, passing the specified `allocator` through to the new elements, and load into the specified `toEnd` an iterator pointing to the end of the data after appending (i&period;e&period;, `fromEnd &plus; numElements`)&period; The behavior is undefined unless `fromEnd &plus; numElements` is a valid iterator (i&period;e&period;, the block pointer array holds enough room after the `fromEnd` position to insert `numElements`)&period;
| xref:BloombergLP/bslalg/DequePrimitives-01/uninitializedFillNFront.adoc[`uninitializedFillNFront`] 
| Prepend the specified `numElements` copies of the specified `value` to the deque starting at the specified `fromBegin` iterator, passing the specified `allocator` through to the new elements, and load into the specified `toBegin` an iterator pointing to the end of the data after prepending, 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;
| xref:BloombergLP/bslalg/DequePrimitives-01/valueInititalizeN.adoc[`valueInititalizeN`] 
| Append the specified `numElements` value&hyphen;initialized objects to the deque ending at the specified `fromEnd` iterator, passing the specified `allocator` through to the new elements, and load into the specified `toEnd` an iterator pointing to the end of the data after appending (i&period;e&period;, `fromEnd &plus; numElements`)&period; The behavior is undefined unless `fromEnd &plus; numElements` is a valid iterator (i&period;e&period;, the block pointer array holds enough room after the `fromEnd` position to insert `numElements`)&period;
|===


== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/DequePrimitives-0c.adoc[`DequePrimitives&lt;VALUE&lowbar;TYPE, 1&gt;`] 
| This is a partial specialization of `DequePrimitives` for the case when there is a single element per block&period;
|===



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