Specialization of allocator_traits for bsl::allocator.

Synopsis

Declared in <bslma_bslallocator.h>

template<class TYPE>
struct allocator_traits<allocator<TYPE>>;

Description

This struct template provides a specialization of the allocator_traits class template for bsl::allocator. This specialization is not strictly necessary, but its presence speeds up compliation by bypassing a significant amount of metaprogramming.

Type Aliases

Name

Description

allocator_type

This typedef is an alias to allocator<TYPE>.

const_pointer

This typedef is an alias to allocator_type::const_pointer.

const_void_pointer

This typedef is an alias to allocator_type::const_void_pointer.

difference_type

This typedef is an alias to allocator_type::difference_type.

is_always_equal

false_type; bsl::allocator instances are not always equal.

pointer

This typedef is an alias to allocator_type::pointer.

propagate_on_container_copy_assignment

false_type; do not propagate the allocator on copy assignment.

propagate_on_container_move_assignment

false_type; do not propagate the allocator on move assignment.

propagate_on_container_swap

false_type; do not propagate the allocator on swap.

rebind_alloc

Rebind this allocator to the specified ELEMENT_TYPE.

rebind_traits

Rebind this allocator traits type to the specified ELEMENT_TYPE.

size_type

This typedef is an alias to allocator_type::size_type.

value_type

This typedef is an alias to the (template parameter) TYPE.

void_pointer

This typedef is an alias to allocator_type::void_pointer.

Static Member Functions

Name

Description

allocate

allocate overloads

construct

construct overloads

deallocate

Deallocate the memory at p previously allocated from m.

destroy

Destroy the object at the specified p.

max_size

Return the maximum number of elements allocatable by m.

select_on_container_copy_construction

Return a default‐constructed allocator for container copy construction.

Created with MrDocs