BloombergLP::bslalg::ArrayPrimitives::moveInsert

TBD: improve comment Move the elements of type given by the allocator_traits class template for (template parameter) ALLOCATOR in the array starting at the specified toBegin location and ending immediately before the specified toEnd location by the specified numElements positions towards larger addresses, and fill the numElements at the toBegin location by moving the elements from the array starting at the specified fromBegin and ending immediately before the specified fromEnd location. 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.

Synopsis

Declared in <bslalg_arrayprimitives.h>

template<class ALLOCATOR>
static
void
moveInsert(
    bsl::allocator_traits<ALLOCATOR>::pointer toBegin,
    bsl::allocator_traits<ALLOCATOR>::pointer toEnd,
    bsl::allocator_traits<ALLOCATOR>::pointer* fromEndPtr,
    bsl::allocator_traits<ALLOCATOR>::pointer fromBegin,
    bsl::allocator_traits<ALLOCATOR>::pointer fromEnd,
    size_type numElements,
    ALLOCATOR allocator);