Specialization of allocator_traits that uses std::allocator_traits.
Synopsis
Declared in <bslma_allocatortraits.h>
template<class ALLOCATOR_TYPE>
struct allocator_traits<std::allocator<ALLOCATOR_TYPE>>;
Description
Since C++17 many of the std::allocator members are deprecated (and removed in C++20). C++23 deprecates type name members and C++26 removes them. The clang compiler on Darwin warns about any mention of those names in C++17 so this header file was producing many warnings. The specialization below "disconnects" the allocator traits of std::allocator from our own implementation and so it avoids not only warnings but possible other hassles as the std::allocator interface is morphing.
Note that we are using the standard traits (in place of ours) only on C++17 or later compilers and not C++11 (when std::allocator_traits appeared). The reason for this is that our bsl::allocator_traits supports allocator_traits::is_always_equal from C++17 in a backwards compatible manner so we cannot use pre‐C++17 standard implementation that does not have that.
Type Aliases
Name |
Description |
Alias template that rebinds the allocator to |
|
|
Using Declarations
Name |
Description |
Allocate uninitialized storage for |
|
This |
|
This |
|
This |
|
Construct an object at the specified uninitialized address. |
|
Deallocate the storage at |
|
Destroy the object at the specified address. |
|
This |
|
|
|
Return the maximum number of objects |
|
This |
|
|
|
|
|
|
|
|
Return the allocator to use when copy‐constructing a container. |
This |
|
This |
|
This |
Created with MrDocs