BloombergLP::bsltf::StdTestAllocator

Minimal C++03-compliant allocator that delegates to a global allocator.

Synopsis

Declared in <bsltf_stdtestallocator.h>

template<class TYPE>
class StdTestAllocator;

Description

This allocator implements the minimal interface to comply with section 20.1.5 ([lib.allocator.requirements]) of the C++03 standard. Instances of this allocator delegate their operations to a globally configured delegate allocator as C++03 compliant allocators cannot have individually identifiable state (see StdTestAllocatorConfiguration and 'StdTestAllocatorConfigurationGuard).

Types

NameDescription
rebind Provide a namespace for a rebound StdTestAllocator type.

Type Aliases

NameDescription
const_pointer Alias for a pointer to const TYPE.
const_reference Alias for a reference to const TYPE.
difference_type Alias for bsls::Types::IntPtr.
pointer Alias for a pointer to TYPE.
reference Alias for a reference to TYPE.
size_type Alias for bsls::Types::UintPtr.
value_type Alias for the allocated TYPE.

Member Functions

NameDescription
StdTestAllocator [constructor]Constructors
address address overloads
allocate Allocate space for the specified numElements objects of type TYPE.
construct Construct an ELEMENT_TYPE object at the specified address.
deallocate Return memory previously allocated at the specified address.
destroy Call the ELEMENT_TYPE destructor for the object at the specified address but do not deallocate the memory at address.
max_size Return the maximum number of TYPE elements this allocator can allocate.
operator BloombergLP::bslmf::NestedTraitDeclaration<StdTestAllocator, IsStdAllocator> Declare StdTestAllocator as a standard allocator.

Specializations

NameDescription
StdTestAllocator<void> This specialization of StdTestAllocator for void type as the parameterized TYPE does not contain members that are unrepresentable for void.

Non-Member Functions

NameDescription
operator!=Return false because StdTestAllocator does not hold a state.
operator==Return true because StdTestAllocator does not hold a state.