BloombergLP::bslalg::AutoArrayMoveDestructor::AutoArrayMoveDestructor

Create a proctor for moving and destroying the specified array ranges.

Synopsis

Declared in <bslalg_autoarraymovedestructor.h>

AutoArrayMoveDestructor(
    OBJECT_TYPE* destination,
    OBJECT_TYPE* begin,
    OBJECT_TYPE* middle,
    OBJECT_TYPE* end,
    ALLOCATOR allocator = ALLOCATOR());

Description

Create a proctor for the sequence of elements of the parameterized OBJECT_TYPE in the specified range [ begin, end )] which, upon destruction, moves the range [ begin, middle )] to the specified destination and destroys the [ middle, end )] range. The behavior is undefined unless begin, middle, and end refer to a contiguous sequence of initialized OBJECT_TYPE objects, where begin <= middle <= end, and destination refers to a contiguous sequence of (uninitialized) memory of sufficient size to hold end - begin OBJECT_TYPE objects (which must not overlap [begin, end)]).

Parameters

NameDescription
destinationaddress to which guarded elements are moved
beginbeginning of the guarded range of initialized elements
middlefirst element to move (also end of the destroy range)
endend of the guarded range (one past the last element)
allocatorallocator used to destroy elements