This struct provides a namespace for a suite of independent utility functions that operate on arrays of elements of parameterized type TARGET_TYPE. Depending on the traits of TARGET_TYPE, the default and copy constructors, destructor, assignment operators, etcetera may not be invoked, optimized away by no-op or bit-wise move or copy.
Declared in <bslalg_arrayprimitives.h>
struct ArrayPrimitives;
| Name | Description |
|---|---|
Imp | Implementation detail for ArrayPrimitives utility functions. |
difference_type | Standard signed difference type used by array primitive operations. |
size_type | Standard unsigned size type used by array primitive operations. |
| Name | Description |
|---|---|
copyConstruct | copyConstruct overloads |
defaultConstruct | defaultConstruct overloads |
destructiveMove | destructiveMove overloads |
destructiveMoveAndEmplace | Move the elements of type allocator_traits<ALLOCATOR>::value_type in the specified range [fromBegin .. fromEnd)] into the uninitialized array beginning at the specified toBegin location, using the specified allocator to supply memory (if required), inserting at the specified position (after translating from fromBegin to toBegin) a newly created object constructed by forwarding allocator (if required) and the specified (variable number of) arguments to the corresponding constructor of the target type, ensuring that the specified fromEndPtr points to the first uninitialized element in [fromBegin .. fromEnd)] as the elements are moved from source to destination. On return, the elements in the input range are invalid, i.e., their destructors must not be called after this operation returns. If a constructor throws an exception during this operation, the output array is left in an uninitialized state. If an exception is thrown during the in-place construction of the new object, the input array is unaffected; otherwise, if a (copy or move) constructor throws an exception during this operation, the input elements in the range [fromBegin .. *fromEndPtr)] are left in a valid but unspecified state and the remaining portion of the input array is left in an uninitialized state. The behavior is undefined unless fromBegin <= position <= fromEnd and toBegin refers to space sufficient to hold fromEnd - fromBegin + 1 elements. |
destructiveMoveAndInsert | destructiveMoveAndInsert overloads |
destructiveMoveAndMoveInsert | destructiveMoveAndMoveInsert overloads |
emplace | emplace overloads |
erase | erase overloads |
insert | insert overloads |
moveConstruct | moveConstruct overloads |
moveInsert | moveInsert overloads |
rotate | Move the elements of the parameterized TARGET_TYPE in the array starting at the specified first address and ending immediately before the specified middle address to the array of the same length ending at the specified last address (and thus starting at the last - (middle - first) address), and move the elements previously in the array starting at middle and ending at last down to the first address. If the assignment operator throws an exception during this process, all of the elements in [ first, last )] will have unspecified, but valid, values. The behavior is undefined unless first <= middle <= last. |
uninitializedFillN | uninitializedFillN overloads |