[#BloombergLP-bslma-ConstructionUtil-destructiveMove]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ConstructionUtil.adoc[ConstructionUtil]::destructiveMove
:relfileprefix: ../../../
:mrdocs:

Create an object of (template parameter) `TARGET&lowbar;TYPE` at the specified `address` by moving from the specified `original` object, then destroy `original`&period; The specified `allocator` is unused (except possibly in precondition checks)&period; The constructed object will have the same allocator (if any) as `original`&period; If `bslmf&colon;&colon;IsBitwiseMoveable&lt;TARGET&lowbar;TYPE&gt;&colon;&colon;value` is `true`, then the entire operation is a simple `memcpy` &hyphen;&hyphen; no constructors or destructors are invoked&semi; otherwise, this method move&hyphen;constructs an object at `address` from the object at `original` then invokes the destructor on `original`&period; If the move constructor throws an exception, the memory at `address` is left in an uninitialized state and `original` is left in a valid but unspecified state&period; The behavior is undefined if `original` uses an allocator other than `allocator` to supply memory&period; Note that if `original` points to an object of a type derived from `TARGET&lowbar;TYPE` (i&period;e&period;, a slicing move) where `TARGET&lowbar;TYPE` has a non&hyphen;`virtual` destructor, then `original` will be only partially destroyed&period;

== Synopsis

Declared in `&lt;bslma&lowbar;constructionutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TARGET&lowbar;TYPE,
    class ALLOCATOR&gt;
static
void
destructiveMove(
    TARGET&lowbar;TYPE* address,
    ALLOCATOR const& allocator,
    TARGET&lowbar;TYPE* original);
----


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