[#BloombergLP-bslalg-ArrayPrimitives-copyConstruct-0eb] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::copyConstruct :relfileprefix: ../../../ :mrdocs: Copy‐construct elements from a range into an uninitialized array. == Synopsis Declared in `<bslalg_arrayprimitives.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TARGET_TYPE, class FWD_ITER, class SENTINEL> static void copyConstruct( TARGET_TYPE* toBegin, FWD_ITER fromBegin, SENTINEL fromEnd, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator); ---- == Description Copy into an uninitialized array of (the template parameter) `TARGET_TYPE` beginning at the specified `toBegin` address, the elements in the array of `TARGET_TYPE` starting at the specified `fromBegin` address and ending immediately before the specified `fromEnd` address. If the (template parameter) `ALLOCATOR` type is derived from `bslma::Allocator` and `TARGET_TYPE` supports `bslma` allocators, then the specified `allocator` is passed to each invocation of the `TARGET_TYPE` copy constructor. If a `TARGET_TYPE` constructor throws an exception during the operation, then the destructor is called on any newly‐constructed elements, leaving the output array in an uninitialized state. == Parameters [cols="1,4"] |=== | Name| Description | *toBegin* | beginning of the uninitialized destination range | *fromBegin* | beginning of the source range | *fromEnd* | end of the source range (one past the last element) | *allocator* | allocator passed to element constructors when applicable |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#