BloombergLP::bslalg::ArrayDestructionPrimitives::destroy

Destroy each TARGET_TYPE in [begin, end)] using an allocator.

Synopsis

Declared in <bslalg_arraydestructionprimitives.h>

template<
    class TARGET_TYPE,
    class ALLOCATOR>
static
void
destroy(
    TARGET_TYPE* begin,
    TARGET_TYPE* end,
    ALLOCATOR allocator,
    bsl::true_type traits);

Description

Destroy each instance of TARGET_TYPE in the array beginning at the specified begin address and ending immediately before the specified end address, using the specified allocator. Elide the use of the destructor entirely if (template parameter) TARGET_TYPE is bitwise copyable, i.e., in the overload where the last argument (used only for overload resolution) is of type bsl::true_type.

Parameters

NameDescription
beginbeginning of the range of elements to destroy
endend of the range of elements to destroy (one past the last)
allocatorallocator used to destroy elements
traitsunused trait tag for overload resolution