Move‐insert a source range, shifting subsequent elements.
Synopsis
Declared in <bslalg_arrayprimitives.h>
template<class TARGET_TYPE>
static
void
moveInsert(
TARGET_TYPE* toBegin,
TARGET_TYPE* toEnd,
TARGET_TYPE** fromEndPtr,
TARGET_TYPE* fromBegin,
TARGET_TYPE* fromEnd,
size_type numElements,
bslma::Allocator* allocator);
Description
Move the elements of the (template parameter) TARGET_TYPE in the array starting at the specified toBegin address and ending immediately before the specified toEnd address by the specified numElements positions towards larger addresses, and fill the numElements at the toBegin address by moving the elements from the array starting at the specified fromBegin and ending immediately before the specified fromEnd address. Keep the iterator at the specified fromEndPtr address pointing to the end of the range as the elements from [ fromBegin, fromEnd )] are moved from source to destination. The behavior is undefined unless the destination array contains numElements uninitialized elements after toEnd, numElements is the distance from fromBegin to fromEnd, and the input and destination arrays do not overlap. If a copy constructor or assignment operator for TARGET_TYPE throws an exception, then any elements created after toEnd are destroyed, the elements in the ranges [ toBegin, toEnd)] and [ fromBegin, *fromEndPtr )] will have unspecified, but valid, values, and the elements in [ *fromEndPtr, fromEnd )] will be destroyed.
Parameters
Name |
Description |
toBegin |
insertion position within the destination array |
toEnd |
end of the populated destination range |
fromEndPtr |
loads the end of the remaining valid source range |
fromBegin |
beginning of the source range to move‐insert |
fromEnd |
end of the source range to move‐insert |
numElements |
number of elements to move‐insert |
allocator |
allocator used to supply memory if required |
Created with MrDocs