BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslalg::ArrayDestructionPrimitives Struct Reference

#include <bslalg_arraydestructionprimitives.h>

Static Public Member Functions

template<class TARGET_TYPE , class ALLOCATOR >
static void destroy (TARGET_TYPE *begin, TARGET_TYPE *end, ALLOCATOR allocator, bsl::true_type)
 
template<class TARGET_TYPE , class ALLOCATOR >
static void destroy (TARGET_TYPE *begin, TARGET_TYPE *end, ALLOCATOR allocator, bsl::false_type)
 
template<class TARGET_TYPE >
static void destroy (TARGET_TYPE *begin, TARGET_TYPE *end, bsl::true_type)
 
template<class TARGET_TYPE >
static void destroy (TARGET_TYPE *begin, TARGET_TYPE *end, bsl::false_type)
 
static void scribbleOverMemory (void *ptr, size_t numBytes)
 
template<class TARGET_TYPE , class ALLOCATOR >
static void destroy (TARGET_TYPE *begin, TARGET_TYPE *end, ALLOCATOR allocator)
 
template<class TARGET_TYPE >
static void destroy (TARGET_TYPE *begin, TARGET_TYPE *end)
 

Detailed Description

This struct provides a namespace for a suite of utility functions that destroy arrays of elements of the parameterized type TARGET_TYPE. Depending on the traits of TARGET_TYPE, the destructor may be invoked, or not (optimized away by no-op).

Member Function Documentation

◆ destroy() [1/6]

template<class TARGET_TYPE >
void bslalg::ArrayDestructionPrimitives::destroy ( TARGET_TYPE *  begin,
TARGET_TYPE *  end 
)
inlinestatic

Destroy of the elements in the segment of an array of parameterized TARGET_TYPE beginning at the specified begin address and ending immediately before the specified end address. If begin == 0 and end == 0 this function has no effect. The behavior is undefined unless either (1) begin <= end, begin != 0, and end != 0, or (2) begin == 0 && end == 0. Note that this method does not deallocate any memory (except memory deallocated by the element destructor calls).

◆ destroy() [2/6]

template<class TARGET_TYPE , class ALLOCATOR >
void bslalg::ArrayDestructionPrimitives::destroy ( TARGET_TYPE *  begin,
TARGET_TYPE *  end,
ALLOCATOR  allocator 
)
inlinestatic

Destroy the elements in the segment of an array of parameterized TARGET_TYPE beginning at the specified begin address and ending immediately before the specified end address, using the specified allocator. If begin == 0 and end == 0 this function has no effect. The behavior is undefined unless either (1) begin <= end, begin != 0, and end != 0, or (2) begin == 0 && end == 0. Note that this method does not deallocate any memory (except memory deallocated by the element destructor calls).

◆ destroy() [3/6]

template<class TARGET_TYPE , class ALLOCATOR >
void bslalg::ArrayDestructionPrimitives::destroy ( TARGET_TYPE *  begin,
TARGET_TYPE *  end,
ALLOCATOR  allocator,
bsl::false_type   
)
static

◆ destroy() [4/6]

template<class TARGET_TYPE , class ALLOCATOR >
void bslalg::ArrayDestructionPrimitives::destroy ( TARGET_TYPE *  begin,
TARGET_TYPE *  end,
ALLOCATOR  allocator,
bsl::true_type   
)
inlinestatic

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.

◆ destroy() [5/6]

template<class TARGET_TYPE >
void bslalg::ArrayDestructionPrimitives::destroy ( TARGET_TYPE *  begin,
TARGET_TYPE *  end,
bsl::false_type   
)
static

◆ destroy() [6/6]

template<class TARGET_TYPE >
void bslalg::ArrayDestructionPrimitives::destroy ( TARGET_TYPE *  begin,
TARGET_TYPE *  end,
bsl::true_type   
)
inlinestatic

Destroy each instance of TARGET_TYPE in the array beginning at the specified begin address and ending immediately before the specified end address. 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) if of type bsl::true_type.

◆ scribbleOverMemory()

static void bslalg::ArrayDestructionPrimitives::scribbleOverMemory ( void *  ptr,
size_t  numBytes 
)
static

Overwrite the specified numBytes of memory starting at the specified ptr.


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