BloombergLP::bslalg::ArrayPrimitives::destructiveMoveAndMoveInsert

Destructively move elements while move-inserting a source range.

Synopsis

Declared in <bslalg_arrayprimitives.h>

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);

Description

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.

Parameters

NameDescription
toBeginbeginning of the uninitialized destination range
fromEndPtrloads the end of the remaining valid source range
lastPtrloads the end of the remaining valid insert range
fromBeginbeginning of the source range
positioninsertion position within the source range
fromEndend of the source range (one past the last element)
firstbeginning of the range of elements to move-insert
lastend of the range of elements to move-insert
numElementsnumber of elements to move-insert from [first .. last)]
allocatorallocator used to supply memory if required