[#bsl-allocator_traits-0108] = xref:bsl.adoc[bsl]::allocator_traits :relfileprefix: ../ :mrdocs: 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. == Synopsis Declared in `<bslma_allocatortraits.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR_TYPE> struct allocator_traits; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/allocator_traits-0108/allocator_type.adoc[`allocator_type`] | This `typedef` is an alias to the (template parameter) `ALLOCATOR_TYPE`. | xref:bsl/allocator_traits-0108/const_pointer.adoc[`const_pointer`] | This `typedef` is an alias to `AllocatorTraits_ConstPointerType<ALLOCATOR_TYPE>::type`. | xref:bsl/allocator_traits-0108/const_void_pointer.adoc[`const_void_pointer`] | Const void pointer type for the allocator. | xref:bsl/allocator_traits-0108/difference_type.adoc[`difference_type`] | This `typedef` is an alias to `AllocatorTraits_DifferenceType<ALLOCATOR_TYPE>::type`. | xref:bsl/allocator_traits-0108/is_always_equal.adoc[`is_always_equal`] | Identical to, or derived from `true_type` if two allocators of parameterized `ALLOCATOR_TYPE` always compare equal; otherwise identical to or derived from `false_type`. This type is `ALLOCATOR_TYPE::is_always_equal` if such a type is defined, and `is_empty<ALLOCATOR_TYPE>` otherwise. | xref:bsl/allocator_traits-0108/pointer.adoc[`pointer`] | This `typedef` is an alias to `AllocatorTraits_PointerType<ALLOCATOR_TYPE>::type`. | xref:bsl/allocator_traits-0108/propagate_on_container_copy_assignment.adoc[`propagate_on_container_copy_assignment`] | Identical to, or derived from `true_type` if an allocator of parameterized `ALLOCATOR_TYPE` should be copied when a container using that `ALLOCATOR_TYPE` is copy‐assigned; otherwise identical to or derived from `false_type`. This type is `ALLOCATOR_TYPE::propagate_on_container_copy_assignment` if such a type is defined, and `false_type` otherwise. | xref:bsl/allocator_traits-0108/propagate_on_container_move_assignment.adoc[`propagate_on_container_move_assignment`] | Identical to, or derived from `true_type` if an allocator of parameterized `ALLOCATOR_TYPE` should be moved when a container using that `ALLOCATOR_TYPE` is move‐assigned; otherwise identical to or derived from `false_type`. This type is `ALLOCATOR_TYPE::propagate_on_container_move_assignment` if such a type is defined, and `false_type` otherwise. | xref:bsl/allocator_traits-0108/propagate_on_container_swap.adoc[`propagate_on_container_swap`] | Identical to, or derived from `true_type` if the allocators of parameterized `ALLOCATOR_TYPE` should be swapped when containers using that `ALLOCATOR_TYPE` are swapped; otherwise identical to or derived from `false_type`. This type is `ALLOCATOR_TYPE::propagate_on_container_swap` if such a type is defined, and `false_type` otherwise. | xref:bsl/allocator_traits-0108/rebind_alloc.adoc[`rebind_alloc`] | Rebind this allocator to the specified `ELEMENT_TYPE`. | xref:bsl/allocator_traits-0108/rebind_traits.adoc[`rebind_traits`] | Rebind this allocator traits type to the specified `ELEMENT_TYPE`. | xref:bsl/allocator_traits-0108/size_type.adoc[`size_type`] | This `typedef` is an alias to `AllocatorTraits_SizeType<ALLOCATOR_TYPE>::type`. | xref:bsl/allocator_traits-0108/value_type.adoc[`value_type`] | This `typedef` is an alias to `ALLOCATOR_TYPE::value_type`. | xref:bsl/allocator_traits-0108/void_pointer.adoc[`void_pointer`] | This `typedef` is an alias to `AllocatorTraits_VoidPointerType<ALLOCATOR_TYPE>::type`. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/allocator_traits-0108/allocate-03.adoc[`allocate`] | `allocate` overloads | xref:bsl/allocator_traits-0108/construct.adoc[`construct`] | Construct an object of (template parameter) type `ELEMENT_TYPE` at the specified `elementAddr`, either by 1) calling the `construct` method on `basicAllocator` with `elemAddr` and the specified (variable number of) `arguments` if the (template parameter) type `ALLOCATOR_TYPE` defines such a method, or 2) forwarding the specified (variable number of) `arguments` to the constructor of `ELEMENT_TYPE` directly (and ignoring `basicAllocator`) otherwise. The behavior is undefined unless `elementAddr` refers to valid, uninitialized storage. | xref:bsl/allocator_traits-0108/deallocate.adoc[`deallocate`] | Invoke `basicAllocator.deallocate(elementAddr, n)`. The behavior is undefined unless the specified `elementAddr` was returned from a prior call to the `allocate` method of an allocator that compares equal to the specified `allocator`, and has not yet been passed to a `deallocate` call of such an allocator object. | xref:bsl/allocator_traits-0108/destroy.adoc[`destroy`] | Destroy the object of (template parameter) type `ELEMENT_TYPE` at the specified `elementAddr`, either by 1) calling the `destroy` method on `basicAllocator` with `elemAddr` as the sole argument if the (template parameter) type `ALLOCATOR_TYPE` defines such a method, or 2) calling the destructor directly on `elementAddr` (and ignoring `basicAllocator`) otherwise. The behavior is undefined unless `elementAddr` refers to a valid, constructed object. | xref:bsl/allocator_traits-0108/max_size.adoc[`max_size`] | Return the largest number of `value_type` objects that could reasonably be returned by a single invocation of `allocate` for the specified `allocator`, i.e., `allocator.max_size()`. | xref:bsl/allocator_traits-0108/select_on_container_copy_construction.adoc[`select_on_container_copy_construction`] | Return a copy of the allocator that should be used to copy‐ construct one container from another container whose allocator is the specified `rhs`. If the parameterized `ALLOCATOR_TYPE` defines a method `select_on_container_copy_construction`, this function returns the result of calling that method on `rhs`; otherwise, this method enforces the default policy of propagating the allocator on copy construction, as is standard practice for standard allocators (i.e., returns `rhs`). Note that the specialization of this class template for `bsl::allocator` (in the `bslma_bslallocator` component) provides the alternate default behavior of _not_ propagating the allocator on copy construction (i.e., returning a default‐constructed allocator object). |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:bsl/allocator_traits-07c.adoc[`allocator_traits<allocator<Attribute>>`] | 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. | xref:bsl/allocator_traits-056.adoc[`allocator_traits<allocator<Json>>`] | 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. | xref:bsl/allocator_traits-010c.adoc[`allocator_traits<allocator<ManagedAttribute>>`] | 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. | xref:bsl/allocator_traits-04e.adoc[`allocator_traits<allocator<MetricSampleGroup>>`] | 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. | xref:bsl/allocator_traits-06c.adoc[`allocator_traits<allocator<UserFieldValue>>`] | 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. | xref:bsl/allocator_traits-046.adoc[`allocator_traits<allocator<ZoneinfoTransition>>`] | 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. | xref:bsl/allocator_traits-015.adoc[`allocator_traits<allocator<bool>>`] | 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. | xref:bsl/allocator_traits-0f26.adoc[`allocator_traits<allocator<char>>`] | 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. | xref:bsl/allocator_traits-093.adoc[`allocator_traits<allocator<char16_t>>`] | 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. | xref:bsl/allocator_traits-00c.adoc[`allocator_traits<allocator<char32_t>>`] | 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. | xref:bsl/allocator_traits-0a6.adoc[`allocator_traits<allocator<char8_t>>`] | 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. | xref:bsl/allocator_traits-083.adoc[`allocator_traits<allocator<double>>`] | 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. | xref:bsl/allocator_traits-064.adoc[`allocator_traits<allocator<float>>`] | 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. | xref:bsl/allocator_traits-0fe.adoc[`allocator_traits<allocator<int>>`] | 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. | xref:bsl/allocator_traits-009.adoc[`allocator_traits<allocator<long>>`] | 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. | xref:bsl/allocator_traits-0b9.adoc[`allocator_traits<allocator<long double>>`] | 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. | xref:bsl/allocator_traits-08d.adoc[`allocator_traits<allocator<long long>>`] | 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. | xref:bsl/allocator_traits-0a5.adoc[`allocator_traits<allocator<short>>`] | 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. | xref:bsl/allocator_traits-04f.adoc[`allocator_traits<allocator<signed char>>`] | 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. | xref:bsl/allocator_traits-071.adoc[`allocator_traits<allocator<unsigned char>>`] | 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. | xref:bsl/allocator_traits-082.adoc[`allocator_traits<allocator<unsigned int>>`] | 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. | xref:bsl/allocator_traits-0fb.adoc[`allocator_traits<allocator<unsigned long>>`] | 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. | xref:bsl/allocator_traits-02.adoc[`allocator_traits<allocator<unsigned long long>>`] | 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. | xref:bsl/allocator_traits-03.adoc[`allocator_traits<allocator<unsigned short>>`] | 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. | xref:bsl/allocator_traits-0c0.adoc[`allocator_traits<allocator<wchar_t>>`] | 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. | xref:bsl/allocator_traits-003.adoc[`allocator_traits<allocator<pair<Date, DayOfWeekSet>>>`] | 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. | xref:bsl/allocator_traits-0fd.adoc[`allocator_traits<allocator<pair<TimeInterval const, Node*>>>`] | 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. | xref:bsl/allocator_traits-060.adoc[`allocator_traits<allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>>`] | 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. | xref:bsl/allocator_traits-0a0.adoc[`allocator_traits<allocator<pair<basic_string<char> const, Json>>>`] | 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. | xref:bsl/allocator_traits-017.adoc[`allocator_traits<allocator<void*>>`] | 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. | xref:bsl/allocator_traits-0e1.adoc[`allocator_traits<allocator<char const*>>`] | 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. | xref:bsl/allocator_traits-0d0.adoc[`allocator_traits<polymorphic_allocator<Attribute>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-00f.adoc[`allocator_traits<polymorphic_allocator<BslAllocator_Voidish>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0ea.adoc[`allocator_traits<polymorphic_allocator<Json>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0e8.adoc[`allocator_traits<polymorphic_allocator<ManagedAttribute>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-098.adoc[`allocator_traits<polymorphic_allocator<MetricSampleGroup>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-065.adoc[`allocator_traits<polymorphic_allocator<UserFieldValue>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-018.adoc[`allocator_traits<polymorphic_allocator<ZoneinfoTransition>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0003.adoc[`allocator_traits<polymorphic_allocator<bool>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-01b.adoc[`allocator_traits<polymorphic_allocator<char>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0c4.adoc[`allocator_traits<polymorphic_allocator<char16_t>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-074.adoc[`allocator_traits<polymorphic_allocator<char32_t>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-07f.adoc[`allocator_traits<polymorphic_allocator<char8_t>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-078.adoc[`allocator_traits<polymorphic_allocator<double>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-092.adoc[`allocator_traits<polymorphic_allocator<float>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-090.adoc[`allocator_traits<polymorphic_allocator<int>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-068.adoc[`allocator_traits<polymorphic_allocator<long>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-08a.adoc[`allocator_traits<polymorphic_allocator<long double>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-054.adoc[`allocator_traits<polymorphic_allocator<long long>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-04b.adoc[`allocator_traits<polymorphic_allocator<short>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0001.adoc[`allocator_traits<polymorphic_allocator<signed char>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0b1.adoc[`allocator_traits<polymorphic_allocator<unsigned char>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-04a.adoc[`allocator_traits<polymorphic_allocator<unsigned int>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-01a8.adoc[`allocator_traits<polymorphic_allocator<unsigned long>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-05b.adoc[`allocator_traits<polymorphic_allocator<unsigned long long>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-09b.adoc[`allocator_traits<polymorphic_allocator<unsigned short>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-01a4.adoc[`allocator_traits<polymorphic_allocator<wchar_t>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0d4.adoc[`allocator_traits<polymorphic_allocator<pair<Date, DayOfWeekSet>>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-08c.adoc[`allocator_traits<polymorphic_allocator<pair<TimeInterval const, Node*>>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0e4c.adoc[`allocator_traits<polymorphic_allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0e43.adoc[`allocator_traits<polymorphic_allocator<pair<basic_string<char> const, Json>>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-086.adoc[`allocator_traits<polymorphic_allocator<void*>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0f21.adoc[`allocator_traits<polymorphic_allocator<char const*>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-05e.adoc[`allocator_traits<allocator<TYPE>>`] | 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. | xref:bsl/allocator_traits-0ae.adoc[`allocator_traits<std::allocator<ALLOCATOR_TYPE>>`] | | xref:bsl/allocator_traits-059.adoc[`allocator_traits<polymorphic_allocator<TYPE>>`] | This `struct` template provides a specialization of the `allocator_traits` class template for `bsl::polymorphic_allocator`. This specialization is not strictly necessary, but its presence speeds up compilation by bypassing a significant amount of metaprogramming. | xref:bsl/allocator_traits-0a4.adoc[`allocator_traits<ALLOCATOR_TYPE*>`] | TBD: improve comment This is an empty class specialization of `allocator_traits` for pointer types that (intentionally) does not define any of the traits typedefs. It's needed in order make unambiguous function overloads that take both a standard allocator by value and a `bslma::Allocator *`. By using the typedefs defined in `allocator_traits` in the signature of functions taking standard allocators, we can ensure that those overloads are not considered when using `bslma`‐style allocators. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/AllocatorUtil_Traits-0f.adoc[`AllocatorUtil_Traits<t_MEMORY_RSRC*, t_TYPE>`] | This specialization is for allocators expressed as a pointer to class derived from `bsl::memory_resource`. The base class will be `bsl::allocator_traits<bsl::allocator<t_TYPE>>` if `t_MEMORY_RSRC` is derived from `bsl::Allocator`; otherwise the base class will be `bsl::allocator_traits<bsl::polymorphic_allocator<t_TYPE>>`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#