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

Destructively move elements while move&hyphen;inserting a source range&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
destructiveMoveAndMoveInsert(
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer toBegin,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer* fromEndPtr,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer* lastPtr,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer fromBegin,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer position,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer fromEnd,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer first,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer last,
    xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size&lowbar;type] numElements,
    ALLOCATOR allocator);
----

== Description

Move, into an uninitialized array beginning at the specified `toBegin` pointer, elements of type given by the `allocator&lowbar;traits` class template for (template parameter) `ALLOCATOR`, from elements starting at the specified `fromBegin` pointer and ending immediately before the specified `fromEnd` address, moving into the specified `position` (after translating from `fromBegin` to `toBegin`) the specified `numElements` elements starting at the specified `first` pointer and ending immediately before the specified `last` pointer&period; Keep the pointer at the specified `fromEndPtr` address pointing to the first uninitialized element in `&lsqb; fromBegin, fromEnd)&rsqb;` as the elements are moved from source to destination&period; The behavior is undefined unless `fromBegin &lt;&equals; position &lt;&equals; fromEnd` and the destination array contains at least `(fromEnd &hyphen; fromBegin) &plus; numElements` uninitialized elements&period; If a constructor or assignment operator for the target type throws an exception, then any elements created in the output array are destroyed and the elements in the range `&lsqb; fromBegin, &ast;fromEndPtr )&rsqb;` will have valid but unspecified values&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *toBegin*
| beginning of the uninitialized destination range
| *fromEndPtr*
| loads the end of the remaining valid source range
| *lastPtr*
| loads the end of the remaining valid insert range
| *fromBegin*
| beginning of the source range
| *position*
| insertion position within the source range
| *fromEnd*
| end of the source range (one past the last element)
| *first*
| beginning of the range of elements to move&hyphen;insert
| *last*
| end of the range of elements to move&hyphen;insert
| *numElements*
| number of elements to move&hyphen;insert from `&lsqb;first &period;&period; last)&rsqb;`
| *allocator*
| allocator used to supply memory if required
|===


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