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

Move the elements of the (template parameter) `TARGET&lowbar;TYPE` in the starting at the specified `fromBegin` address and ending immediately before the specified `fromEnd` address 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`) `numElements` objects initialized to default values, 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 a default constructor throws an exception, 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; numElements` elements&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TARGET&lowbar;TYPE&gt;
static
void
destructiveMoveAndInsert(
    TARGET&lowbar;TYPE* toBegin,
    TARGET&lowbar;TYPE** fromEndPtr,
    TARGET&lowbar;TYPE* fromBegin,
    TARGET&lowbar;TYPE* position,
    TARGET&lowbar;TYPE* fromEnd,
    xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size&lowbar;type] numElements,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator);
----


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