Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

bslma::DeleterHelper Struct Reference

#include <bslma_deleterhelper.h>

List of all members.

Static Public Member Functions

template<class TYPE , class ALLOCATOR >
static void deleteObject (const TYPE *object, ALLOCATOR *allocator)
template<class TYPE , class ALLOCATOR >
static void deleteObjectRaw (const TYPE *object, ALLOCATOR *allocator)

Detailed Description

This struct provides a namespace for helper functions used for deleting objects in various pools and allocators.

See Component bslma_deleterhelper


Member Function Documentation

template<class TYPE , class ALLOCATOR >
static void bslma::DeleterHelper::deleteObject ( const TYPE *  object,
ALLOCATOR *  allocator 
) [static]

Destroy the specified object based on its dynamic type and then use the specified allocator to deallocate its memory footprint. Do nothing if object is a null pointer. The behavior is undefined unless allocator is non-null, and object, when cast appropriately to void *, was allocated using allocator and has not already been deallocated. Note that dynamic_cast<void *>(object) is applied if TYPE is polymorphic, and static_cast<void *>(object) is applied otherwise.

template<class TYPE , class ALLOCATOR >
static void bslma::DeleterHelper::deleteObjectRaw ( const TYPE *  object,
ALLOCATOR *  allocator 
) [static]

Destroy the specified object and then use the specified allocator to deallocate its memory footprint. Do nothing if object is a null pointer. The behavior is undefined unless allocator is non-null, object is not a secondary base class pointer (i.e., the address is (numerically) the same as when it was originally dispensed by allocator), and object was allocated using allocator and has not already been deallocated.


The documentation for this struct was generated from the following file: