[#BloombergLP-bslalg-ScalarPrimitives-copyConstruct-02]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ScalarPrimitives.adoc[ScalarPrimitives]::copyConstruct
:relfileprefix: ../../../
:mrdocs:

Copy&hyphen;construct a `TARGET&lowbar;TYPE` at `address` from `original`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TARGET&lowbar;TYPE&gt;
static
void
copyConstruct(
    TARGET&lowbar;TYPE* address,
    TARGET&lowbar;TYPE const& original,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator);
----

== Description

Build an object of the parameterized `TARGET&lowbar;TYPE` from the specified `original` object of the same `TARGET&lowbar;TYPE` in the uninitialized memory at the specified `address`, as if by using the copy constructor of `TARGET&lowbar;TYPE`&period; If the specified `allocator` is based on `bslma&colon;&colon;Allocator` and `TARGET&lowbar;TYPE` takes an allocator constructor argument, then `allocator` is passed to the copy constructor&period; If the constructor throws, the `address` is left in an uninitialized state&period; Note that bit&hyphen;wise copy will be used if `TARGET&lowbar;TYPE` has the bit&hyphen;wise copyable trait&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *address*
| address of uninitialized storage
| *original*
| object to copy from
| *allocator*
| allocator to use if the type uses an allocator
|===


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