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

Copy into an uninitialized array of (the template parameter) `TARGET&lowbar;TYPE` beginning at the specified `toBegin` address, the elements in the array of `TARGET&lowbar;TYPE` starting at the specified `fromBegin` address and ending immediately before the specified `fromEnd` address&period; If the (template parameter) `ALLOCATOR` type is derived from `bslma&colon;&colon;Allocator` and `TARGET&lowbar;TYPE` supports `bslma` allocators, then the specified `allocator` is passed to each invocation of the `TARGET&lowbar;TYPE` copy constructor&period; If a `TARGET&lowbar;TYPE` constructor throws an exception during the operation, then the destructor is called on any newly&hyphen;constructed elements, leaving the output array in an uninitialized state&period;

== Synopsis

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

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


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