BloombergLP::bslalg::ArrayPrimitives::destructiveMoveAndMoveInsert

destructiveMoveAndMoveInsert overloads

Synopses

Declared in <bslalg_arrayprimitives.h>

TBD: improve comment Move, into an uninitialized array beginning at the specified toBegin pointer, elements of type given by the allocator_traits class template for (template parameter) ALLOCATOR, from elements starting at the specified fromBegin pointer and ending immediately before the specified fromEnd address, moving into the specified position (after translating from fromBegin to toBegin) the specified numElements elements starting at the specified first pointer and ending immediately before the specified last pointer. 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 constructor or assignment operator for the 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 valid but unspecified values.

template<class ALLOCATOR>
static
void
destructiveMoveAndMoveInsert(
    bsl::allocator_traits<ALLOCATOR>::pointer toBegin,
    bsl::allocator_traits<ALLOCATOR>::pointer* fromEndPtr,
    bsl::allocator_traits<ALLOCATOR>::pointer* lastPtr,
    bsl::allocator_traits<ALLOCATOR>::pointer fromBegin,
    bsl::allocator_traits<ALLOCATOR>::pointer position,
    bsl::allocator_traits<ALLOCATOR>::pointer fromEnd,
    bsl::allocator_traits<ALLOCATOR>::pointer first,
    bsl::allocator_traits<ALLOCATOR>::pointer last,
    size_type numElements,
    ALLOCATOR allocator);
» more...

Move the elements of (template parameter) 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, moving into the specified position (after translating from fromBegin to toBegin) the specified numElements of the TARGET_TYPE from the array starting at the specified first address and ending immediately before the specified last address. Keep the pointer at the specified fromEndPtr address pointing to the first uninitialized element in [fromBegin, fromEnd)], and the pointer at the specified lastPtr address pointing to the end of the moved range as the elements from the range [ first, last)] 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 in [ *lastPtr, last )] as well as in [ toBegin, ... )] are destroyed, and the elements in the ranges [ first, *lastPtr )] and [ fromBegin, *fromEndPtr )] will have unspecified but valid values.

template<class TARGET_TYPE>
static
void
destructiveMoveAndMoveInsert(
    TARGET_TYPE* toBegin,
    TARGET_TYPE** fromEndPtr,
    TARGET_TYPE** lastPtr,
    TARGET_TYPE* fromBegin,
    TARGET_TYPE* position,
    TARGET_TYPE* fromEnd,
    TARGET_TYPE* first,
    TARGET_TYPE* last,
    size_type numElements,
    bslma::Allocator* allocator);
» more...