Uniform interface to nested types and operations of any allocator.
Synopsis
Declared in <bslma_allocatortraits.h>
template<class ALLOCATOR_TYPE>
struct allocator_traits;
Description
This class supports the complete interface of the C++11 allocator_traits class template, which provides a uniform mechanism for accessing nested types within, and operations on, any standard‐conforming allocator. A specialization of this class template for bsl::allocator provides support for Bloomberg's bslma allocator model (see the bslma_bslallocator component for more details). In C++11 compilation environments, the construct methods forward to the allocator's construct method if such a method matching the (variable number of) specified constructor arguments exists; otherwise, the construct method falls back to invoking the constructor of the element type directly. In C++03 compilation environments, there is no reliable way to detect if the type provide a method that matches a (variable number of) specified arguments; therefore, we require that standard allocator types define construct methods taking a variable number of arguments in those environments. This implementation is not fully‐standard‐conforming in that it does not support deduce data types that are not specified in the allocator.
Type Aliases
Name |
Description |
This |
|
This |
|
Const void pointer type for the allocator. |
|
This |
|
|
|
This |
|
|
|
|
|
|
|
Rebind this allocator to the specified |
|
Rebind this allocator traits type to the specified |
|
This |
|
This |
|
This |
Static Member Functions
Name |
Description |
|
|
Construct an |
|
Deallocate the storage at |
|
Destroy the |
|
Return the maximum number of objects |
|
|
Return the allocator to use when copy‐constructing a container. |
Specializations
Name |
Description |
Specialization of |
|
|
Specialization of |
Empty specialization of |
Derived Classes
Name |
Description |
|
Traits for an allocator expressed as a pointer to a memory resource. |
Created with MrDocs