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

This `struct` provides a namespace for a suite of independent utility functions that operate on arrays of elements of parameterized type `TARGET&lowbar;TYPE`&period; Depending on the traits of `TARGET&lowbar;TYPE`, the default and copy constructors, destructor, assignment operators, etcetera may not be invoked, optimized away by no&hyphen;op or bit&hyphen;wise move or copy&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct ArrayPrimitives;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/ArrayPrimitives/Imp.adoc[`Imp`] 
| Implementation detail for `ArrayPrimitives` utility functions&period;
| xref:BloombergLP/bslalg/ArrayPrimitives/difference_type.adoc[`difference&lowbar;type`] 
| Standard signed difference type used by array primitive operations&period;
| xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[`size&lowbar;type`] 
| Standard unsigned size type used by array primitive operations&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-073.adoc[`copyConstruct`] 
| `copyConstruct` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/defaultConstruct-03.adoc[`defaultConstruct`] 
| `defaultConstruct` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMove-08.adoc[`destructiveMove`] 
| `destructiveMove` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndEmplace.adoc[`destructiveMoveAndEmplace`] 
| Move the elements of type `allocator&lowbar;traits&lt;ALLOCATOR&gt;&colon;&colon;value&lowbar;type` in the specified range `&lsqb;fromBegin &period;&period; fromEnd)&rsqb;` 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 `&lsqb;fromBegin &period;&period; fromEnd)&rsqb;` as the elements are moved from source to destination&period; On return, the elements in the input range are invalid, i&period;e&period;, their destructors must not be called after this operation returns&period; If a constructor throws an exception during this operation, the output array is left in an uninitialized state&period; If an exception is thrown during the in&hyphen;place construction of the new object, the input array is unaffected&semi; otherwise, if a (copy or move) constructor throws an exception during this operation, the input elements in the range `&lsqb;fromBegin &period;&period; &ast;fromEndPtr)&rsqb;` are left in a valid but unspecified state and the remaining portion of the input array is left in an uninitialized state&period; The behavior is undefined unless `fromBegin &lt;&equals; position &lt;&equals; fromEnd` and `toBegin` refers to space sufficient to hold `fromEnd &hyphen; fromBegin &plus; 1` elements&period;
| xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-08.adoc[`destructiveMoveAndInsert`] 
| `destructiveMoveAndInsert` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndMoveInsert-07c.adoc[`destructiveMoveAndMoveInsert`] 
| `destructiveMoveAndMoveInsert` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/emplace-0e.adoc[`emplace`] 
| `emplace` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/erase-00.adoc[`erase`] 
| `erase` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/insert-0ad.adoc[`insert`] 
| `insert` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/moveConstruct-00.adoc[`moveConstruct`] 
| `moveConstruct` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/moveInsert-04d.adoc[`moveInsert`] 
| `moveInsert` overloads
| xref:BloombergLP/bslalg/ArrayPrimitives/rotate.adoc[`rotate`] 
| Move the elements of the parameterized `TARGET&lowbar;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 &hyphen; (middle &hyphen; first)` address), and move the elements previously in the array starting at `middle` and ending at `last` down to the `first` address&period; If the assignment operator throws an exception during this process, all of the elements in `&lsqb; first, last )&rsqb;` will have unspecified, but valid, values&period; The behavior is undefined unless `first &lt;&equals; middle &lt;&equals; last`&period;
| xref:BloombergLP/bslalg/ArrayPrimitives/uninitializedFillN-04.adoc[`uninitializedFillN`] 
| `uninitializedFillN` overloads
|===



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