BloombergLP::bslalg::ArrayPrimitives::moveConstruct

Move-construct elements from a range into an uninitialized array.

Synopsis

Declared in <bslalg_arrayprimitives.h>

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

Description

Move the elements of the (template parameter) TARGET_TYPE starting at the specified fromBegin address and ending immediately before the specified fromEnd address into the uninitialized array of TARGET_TYPE beginning at the specified toBegin address, using the specified allocator to supply memory (if required). The elements in the input array are left in a valid but unspecified state. If a constructor throws an exception during this operation, the output array is left in an uninitialized state. The behavior is undefined unless toBegin refers to space sufficient to hold fromEnd - fromBegin elements.

Parameters

NameDescription
toBeginbeginning of the uninitialized destination range
fromBeginbeginning of the source range
fromEndend of the source range (one past the last element)
allocatorallocator used to supply memory if required