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>

template<
    class VALUE_TYPE,
    int BLOCK_LENGTH>
struct DequePrimitives;

Type Aliases

Name

Description

Iterator

This typedef is an alias for a deque iterator.

size_type

This typedef is an alias for size_type.

Static Member Functions

Name

Description

destruct

destruct overloads

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).

emplaceAndMoveToBackDispatch

emplaceAndMoveToBackDispatch overloads

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).

emplaceAndMoveToFrontDispatch

emplaceAndMoveToFrontDispatch overloads

erase

erase overloads

insertAndMoveToBack

insertAndMoveToBack overloads

insertAndMoveToFront

insertAndMoveToFront overloads

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.

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.

moveInsertAndMoveToBack

moveInsertAndMoveToBack overloads

moveInsertAndMoveToFront

moveInsertAndMoveToFront overloads

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).

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).

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

Name

Description

DequePrimitives<VALUE_TYPE, 1>

This is a partial specialization of DequePrimitives for the case when there is a single element per block.

Created with MrDocs