[#BloombergLP-bslalg-ArrayPrimitives-emplace-04] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::emplace :relfileprefix: ../../../ :mrdocs: Insert a newly created object of the (template parameter) type `TARGET_TYPE`, constructed by forwarding the specified `allocator` (if required) and the specified (variable number of) `arguments` to the corresponding constructor of `TARGET_TYPE`, into the array at the specified `toBegin` address, shifting the elements from `toBegin` to the specified `toEnd` address up one position towards larger addresses. If an exception is thrown during the in‐place construction of the new object, the elements in the range `[toBegin .. toEnd)]` are unaffected; otherwise, if a (copy or move) constructor or a (copy or move) assignment operator throws an exception, then any elements created after `toEnd` are destroyed and the elements in the range `[toBegin .. toEnd )]` are left in a valid but unspecified state. The behavior is undefined unless `toBegin` refers to sufficient space to hold at least `toEnd ‐ toBegin + 1` elements. == Synopsis Declared in `<bslalg_arrayprimitives.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TARGET_TYPE, class... ARGS> static void emplace( TARGET_TYPE* toBegin, TARGET_TYPE* toEnd, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator, ARGS&&... args); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#