[#BloombergLP-bslalg-ArrayPrimitives-insert-09] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::insert :relfileprefix: ../../../ :mrdocs: Insert the specified `numElements` copies of the specified `value` into the array of type `allocator_traits<ALLOCATOR>::value_type` starting at the specified `toBegin` location, shifting forward the elements from `toBegin` to the specified `toEnd` location by `numElements` positions. If a (copy or move) constructor or a (copy or move) assignment operator throws an exception, 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 space sufficient to hold at least `toEnd ‐ toBegin + numElements` elements. == Synopsis Declared in `<bslalg_arrayprimitives.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> static void insert( bsl::allocator_traits<ALLOCATOR>::pointer toBegin, bsl::allocator_traits<ALLOCATOR>::pointer toEnd, bsl::allocator_traits<ALLOCATOR>::value_type const& value, xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size_type] numElements, ALLOCATOR allocator); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#