[#BloombergLP-bslalg-ArrayPrimitives-destructiveMoveAndInsert-08] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::destructiveMoveAndInsert :relfileprefix: ../../../ :mrdocs: `destructiveMoveAndInsert` overloads == Synopses Declared in `<bslalg_arrayprimitives.h>` Move 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), inserting at the specified `position` (after translating from `fromBegin` to `toBegin`) the specified `numElements` objects initialized to default values, ensuring that the specified `fromEndPtr` points to the first uninitialized element in `[fromBegin .. fromEnd)]` as the elements are moved from source to destination. On return, the elements in the input range are invalid, i.e., their destructors must not be called after this operation returns. If a constructor throws an exception during this operation, the output array is left in an uninitialized state. If a default constructor throws an exception, the input array is unaffected; otherwise, if a (copy or move) constructor throws an exception during this operation, the input elements in the range `[fromBegin .. *fromEndPtr)]` are left in a valid but unspecified state and the remaining portion of the input array is left in an uninitialized state. The behavior is undefined unless 'fromBegin <= position <= fromEnd' and `toBegin` refers to space sufficient to hold `fromEnd ‐ fromBegin + 1` elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> static void xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-01.adoc[destructiveMoveAndInsert]( bsl::allocator_traits<ALLOCATOR>::pointer toBegin, bsl::allocator_traits<ALLOCATOR>::pointer* fromEndPtr, bsl::allocator_traits<ALLOCATOR>::pointer fromBegin, bsl::allocator_traits<ALLOCATOR>::pointer position, bsl::allocator_traits<ALLOCATOR>::pointer fromEnd, xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size_type] numElements, ALLOCATOR allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-01.adoc[_» more..._]# Move the elements of the (template parameter) `TARGET_TYPE` in the starting at the specified `fromBegin` address and ending immediately before the specified `fromEnd` address into the uninitialized array beginning at the specified `toBegin` location using the specified `allocator` to supply memory (if required), inserting at the specified `position` (after translating from `fromBegin` to `toBegin`) `numElements` objects initialized to default values, ensuring that the specified `fromEndPtr` points to the first uninitialized element in `[fromBegin .. fromEnd)]` as the elements are moved from source to destination. On return, the elements in the input range are invalid, i.e., their destructors must not be called after this operation returns. If a constructor throws an exception during this operation, the output array is left in an uninitialized state. If a default constructor throws an exception, the input array is unaffected; otherwise, if a (copy or move) constructor throws an exception during this operation, the input elements in the range `[fromBegin .. *fromEndPtr)]` are left in a valid but unspecified state and the remaining portion of the input array is left in an uninitialized state. The behavior is undefined unless `fromBegin <= position <= fromEnd` and `toBegin` refers to space sufficient to hold `fromEnd ‐ fromBegin + numElements` elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TARGET_TYPE> static void xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-06.adoc[destructiveMoveAndInsert]( TARGET_TYPE* toBegin, TARGET_TYPE** fromEndPtr, TARGET_TYPE* fromBegin, TARGET_TYPE* position, TARGET_TYPE* fromEnd, xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size_type] numElements, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-06.adoc[_» more..._]# Move 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), inserting at the specified `position` (after translating from `fromBegin` to `toBegin`) the specified `numElements` copies of the specified `value`, ensuring that the specified `fromEndPtr` points to the first uninitialized element in `[fromBegin .. fromEnd)]` as the elements are moved from source to destination. On return, the elements in the input range are invalid, i.e., their destructors must not be called after this operation returns. If a constructor throws an exception during this operation, the output array is left in an uninitialized state. If a (copy or move) constructor throws an exception during this operation, the input elements in the range `[fromBegin .. *fromEndPtr)]` are left in a valid but unspecified state and the remaining portion of the input array is left in an uninitialized state. The behavior is undefined unless `fromBegin <= position <= fromEnd` and `toBegin` refers to space sufficient to hold `fromEnd ‐ fromBegin + numElements` elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> static void xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-0c1.adoc[destructiveMoveAndInsert]( bsl::allocator_traits<ALLOCATOR>::pointer toBegin, bsl::allocator_traits<ALLOCATOR>::pointer* fromEndPtr, bsl::allocator_traits<ALLOCATOR>::pointer fromBegin, bsl::allocator_traits<ALLOCATOR>::pointer position, bsl::allocator_traits<ALLOCATOR>::pointer fromEnd, bsl::allocator_traits<ALLOCATOR>::value_type const& value, xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size_type] numElements, ALLOCATOR allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-0c1.adoc[_» more..._]# Move the elements of the parameterized `TARGET_TYPE` in the array starting at the specified `fromBegin` address and ending immediately before the specified `fromEnd` address into an uninitialized array of `TARGET_TYPE` at the specified `toBegin` address, inserting at the specified `position` (after translating from `fromBegin` to `toBegin`) the specified `numElements` copies of the specified `value`. Keep the pointer at the specified `fromEndPtr` address pointing to the first uninitialized element in '[ fromBegin,] fromEnd)' as the elements are moved from source to destination. The behavior is undefined unless `fromBegin <= position <= fromEnd` and the destination array contains at least `(fromEnd ‐ fromBegin) + numElements` uninitialized elements. If a copy constructor or assignment operator for `TARGET_TYPE` throws an exception, then any elements created in the output array are destroyed and the elements in the range `[ fromBegin, *fromEndPtr )]` will have unspecified but valid values. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TARGET_TYPE> static void xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-03.adoc[destructiveMoveAndInsert]( TARGET_TYPE* toBegin, TARGET_TYPE** fromEndPtr, TARGET_TYPE* fromBegin, TARGET_TYPE* position, TARGET_TYPE* fromEnd, TARGET_TYPE const& value, xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size_type] numElements, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-03.adoc[_» more..._]# Move 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), inserting at the specified `position` (after translating from `fromBegin` to `toBegin`) the specified `numElements` copies of the non‐modifiable elements from the range starting at the specified `first` iterator of (template parameter) type `FWD_ITER` and ending immediately before the specified `last` sentinel or iterator, ensuring that the specified `fromEndPtr` points to the first uninitialized element in `[fromBegin .. fromEnd)]` as the elements are moved from source to destination. On return, the elements in the input range are invalid, i.e., their destructors must not be called after this operation returns. If a constructor throws an exception during this operation, the output array is left in an uninitialized state. If a constructor other than the copy or move constructor throws an exception during this operation, the input array is unaffected; otherwise, if a copy or move constructor throws an exception during this operation, the input elements in the range `[fromBegin .. *fromEndPtr)]` are left in a valid but unspecified state and the remaining portion of the input array is left in an uninitialized state. The behavior is undefined unless `fromBegin <= position <= fromEnd` and `toBegin` refers to space sufficient to hold `fromEnd ‐ fromBegin + numElements` elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ALLOCATOR, class FWD_ITER, class SENTINEL> static void xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-0c9.adoc[destructiveMoveAndInsert]( bsl::allocator_traits<ALLOCATOR>::pointer toBegin, bsl::allocator_traits<ALLOCATOR>::pointer* fromEndPtr, bsl::allocator_traits<ALLOCATOR>::pointer fromBegin, bsl::allocator_traits<ALLOCATOR>::pointer position, bsl::allocator_traits<ALLOCATOR>::pointer fromEnd, FWD_ITER first, SENTINEL last, xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size_type] numElements, ALLOCATOR allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-0c9.adoc[_» more..._]# Move the elements of the parameterized `TARGET_TYPE` in the array starting at the specified `fromBegin` address and ending immediately before the specified `fromEnd` address into an uninitialized array of `TARGET_TYPE` at the specified `toBegin` address, inserting at the specified `position` (after translating from `fromBegin` to `toBegin`) the specified `numElements` copies of the non‐modifiable elements from the range starting at the specified `first` iterator of the parameterized `FWD_ITER` type and ending immediately before the specified `last` sentinel or iterator. Keep the pointer at the specified `fromEndPtr` to point to the first uninitialized element in `[fromBegin, fromEnd)]` as the elements are moved from source to destination. The behavior is undefined unless `fromBegin <= position <= fromEnd`, the destination array contains at least `(fromEnd ‐ fromBegin) + numElements` uninitialized elements after `toBegin`, and `numElements` is the distance from `first` to `last`. If a copy constructor or assignment operator for `TARGET_TYPE` throws an exception, then any elements created in the output array are destroyed and the elements in the range `[ fromBegin, *fromEndPtr )]` will have unspecified but valid values. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TARGET_TYPE, class FWD_ITER, class SENTINEL> static void xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-07.adoc[destructiveMoveAndInsert]( TARGET_TYPE* toBegin, TARGET_TYPE** fromEndPtr, TARGET_TYPE* fromBegin, TARGET_TYPE* position, TARGET_TYPE* fromEnd, FWD_ITER first, SENTINEL last, xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size_type] numElements, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/destructiveMoveAndInsert-07.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#