BloombergLP::bslma::AllocatorUtil::deleteObject

Destroy the object at p and deallocate its storage.

Synopsis

Declared in <bslma_allocatorutil.h>

template<
    class t_ALLOCATOR,
    class t_POINTER>
static
void
deleteObject(
    t_ALLOCATOR const& allocator,
    t_POINTER p);

Description

Destroy the object at the specified p address and return the block of memory at p to the specified allocator. The behavior is undefined unless p refers to a fully constructed object allocated from a copy of allocator and not yet destroyed or deallocated.

Parameters

NameDescription
allocatorallocator to which to return the memory
paddress of the fully constructed object to destroy and deallocate