destructiveMove 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). 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 move constructor of a non‐copy‐constructible type throws an exception during this operation, the input array is unaffected; otherwise, if the move constructor of a non‐copy‐constructible type throws an exception during this operation, the input array is left in a valid but unspecified state. The behavior is undefined unless toBegin refers to space sufficient to hold fromEnd ‐ fromBegin elements.

template<class ALLOCATOR>
static
void
destructiveMove(
    bsl::allocator_traits<ALLOCATOR>::pointer toBegin,
    bsl::allocator_traits<ALLOCATOR>::pointer fromBegin,
    bsl::allocator_traits<ALLOCATOR>::pointer fromEnd,
    ALLOCATOR allocator);

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 beginning at the specified toBegin address. On return, the elements in the input range are invalid, i.e., their destructors must not be called after this operation returns. If the parameterized ALLOCATOR type is derived from bslma::Allocator and TARGET_TYPE supports bslma allocators, then the specified allocator is used by the objects in their new location. If an exception is thrown by a TARGET_TYPE constructor during the operation, then the output array is left in an uninitialized state and the input elements remain in their original state.

template<class TARGET_TYPE>
static
void
destructiveMove(
    TARGET_TYPE* toBegin,
    TARGET_TYPE* fromBegin,
    TARGET_TYPE* fromEnd,
    bslma::Allocator* allocator);

Created with MrDocs