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

`destructiveMoveAndMoveInsert` overloads

== Synopses

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

TBD&colon; improve comment 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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndMoveInsert-0d.adoc[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);
----

[.small]#xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndMoveInsert-0d.adoc[_» more&period;&period;&period;_]#

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


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

[.small]#xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndMoveInsert-076.adoc[_» more&period;&period;&period;_]#


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