[#BloombergLP-bslalg-ArrayPrimitives-copyConstruct-073] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::copyConstruct :relfileprefix: ../../../ :mrdocs: `copyConstruct` overloads == Synopses Declared in `<bslalg_arrayprimitives.h>` Same as the preceding `copyConstruct` overload, for pointer ranges. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ALLOCATOR, class SOURCE_TYPE> static void xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-070.adoc[copyConstruct]( bsl::allocator_traits<ALLOCATOR>::pointer toBegin, SOURCE_TYPE* fromBegin, SOURCE_TYPE* fromEnd, ALLOCATOR allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-070.adoc[_» more..._]# Same as the preceding overload, taking pointer iterators. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TARGET_TYPE, class SOURCE_TYPE> static void xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-0e8.adoc[copyConstruct]( TARGET_TYPE* toBegin, SOURCE_TYPE* fromBegin, SOURCE_TYPE* fromEnd, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-0e8.adoc[_» more..._]# Copy the elements of type `allocator_traits<ALLOCATOR>::value_type` in the range beginning at the specified `fromBegin` location and ending immediately before the specified `fromEnd` location into the uninitialized array beginning at the specified `toBegin` location, using the specified `allocator` to supply memory (if required). If a constructor throws an exception during this operation, the output array is left in an uninitialized state. The behavior is undefined unless `toBegin` refers to space sufficient to hold `fromEnd ‐ fromBegin` elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ALLOCATOR, class FWD_ITER, class SENTINEL> static void xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-0c.adoc[copyConstruct]( bsl::allocator_traits<ALLOCATOR>::pointer toBegin, FWD_ITER fromBegin, SENTINEL fromEnd, ALLOCATOR allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-0c.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TARGET_TYPE, class FWD_ITER, class SENTINEL> static void xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-0eb.adoc[copyConstruct]( TARGET_TYPE* toBegin, FWD_ITER fromBegin, SENTINEL fromEnd, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/copyConstruct-0eb.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#