[#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_TYPE` and `BLOCK_LENGTH`. Depending on the traits of `VALUE_TYPE`, the default and copy constructors, destructor, assignment operators, etcetera may not be invoked, and instead the operation can be optimized using a no‐op, bitwise move, or bitwise copy. == Synopsis Declared in `<bslalg_dequeprimitives.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE_TYPE, int BLOCK_LENGTH> 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. | xref:BloombergLP/bslalg/DequePrimitives-01/size_type.adoc[`size_type`] | This `typedef` is an alias for `size_type`. |=== == 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_TYPE` object, constructed by forwarding the specified `allocator` (if required) and the specified (variable number of) `arguments` to the corresponding constructor of `VALUE_TYPE`, and move the elements in the range `[position .. fromEnd)]` forward by 1 position. Load into the specified `toEnd` an iterator one past the inserted element (i.e., `fromEnd + 1`). The behavior is undefined unless `fromEnd + 1` is a valid iterator (i.e., the block pointer array holds enough room after the `fromEnd` position to insert 1 element). | 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_TYPE` object, constructed by forwarding the specified `allocator` (if required) and the specified (variable number of) `arguments` to the corresponding constructor of `VALUE_TYPE`, and move the elements in the range `[fromBegin .. position)]` backward by 1 position. Load into the specified `toBegin` an iterator to the inserted element (i.e., `fromBegin ‐ 1`). The behavior is undefined unless `fromBegin ‐ 1` is a valid iterator (i.e., the block pointer array holds enough room before the `fromBegin` position to insert 1 element). | 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::memmove`. Also load into `destination` the value `destination ‐ numElements` and `source` the value `source ‐ numElements`. The behavior is undefined unless `destination >= source`. | xref:BloombergLP/bslalg/DequePrimitives-01/moveFront.adoc[`moveFront`] | Move the specified `numElements` from the specified `source` to the specified `destination` using `std::memmove`. Also load into `destination` the value `destination + numElements` and `source` the the value `source + numElements`. The behavior is undefined unless `destination <= source`. | 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.e., `fromEnd + numElements`). The behavior is undefined unless `fromEnd + numElements` is a valid iterator (i.e., the block pointer array holds enough room after the `fromEnd` position to insert `numElements`). | 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.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 `fromBegin` position to insert `numElements`). | xref:BloombergLP/bslalg/DequePrimitives-01/valueInititalizeN.adoc[`valueInititalizeN`] | Append the specified `numElements` value‐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.e., `fromEnd + numElements`). The behavior is undefined unless `fromEnd + numElements` is a valid iterator (i.e., the block pointer array holds enough room after the `fromEnd` position to insert `numElements`). |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslalg/DequePrimitives-0c.adoc[`DequePrimitives<VALUE_TYPE, 1>`] | This is a partial specialization of `DequePrimitives` for the case when there is a single element per block. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#