[#BloombergLP-bslma-AllocatorUtil_Traits-0f] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil_Traits-02.adoc[AllocatorUtil_Traits]<t_MEMORY_RSRC*, t_TYPE> :relfileprefix: ../../ :mrdocs: Traits for an allocator expressed as a pointer to a memory resource. == Synopsis Declared in `<bslma_allocatorutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_MEMORY_RSRC, class t_TYPE> struct xref:BloombergLP/bslma/AllocatorUtil_Traits-02.adoc[AllocatorUtil_Traits]<t_MEMORY_RSRC*, t_TYPE> : xref:bsl/allocator_traits-0108.adoc[bsl::allocator_traits<bsl::conditional<bsl::is_convertible<t_MEMORY_RSRC *, bslma::Allocator *>::value, bsl::allocator<t_TYPE>, bsl::polymorphic_allocator<t_TYPE>>::type>] ---- == Description 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>>`. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:bsl/allocator_traits-0108.adoc[bsl::allocator_traits<bsl::conditional<bsl::is_convertible<t_MEMORY_RSRC *, bslma::Allocator *>::value, bsl::allocator<t_TYPE>, bsl::polymorphic_allocator<t_TYPE>>::type>]` | Uniform interface to nested types and operations of any allocator. |=== == 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`] | `true_type` if two allocators always compare equal; else `false_type`. | 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`] | `true_type` if the allocator propagates on copy assignment. | xref:bsl/allocator_traits-0108/propagate_on_container_move_assignment.adoc[`propagate_on_container_move_assignment`] | `true_type` if the allocator propagates on move assignment. | xref:bsl/allocator_traits-0108/propagate_on_container_swap.adoc[`propagate_on_container_swap`] | `true_type` if the allocator propagates on container swap. | 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 `ELEMENT_TYPE` object at `elementAddr`. | xref:bsl/allocator_traits-0108/deallocate.adoc[`deallocate`] | Deallocate the storage at `elementAddr` for `n` objects. | xref:bsl/allocator_traits-0108/destroy.adoc[`destroy`] | Destroy the `ELEMENT_TYPE` object at `elementAddr`. | xref:bsl/allocator_traits-0108/max_size.adoc[`max_size`] | Return the maximum number of objects `allocate` can return. | xref:bsl/allocator_traits-0108/select_on_container_copy_construction.adoc[`select_on_container_copy_construction`] | Return the allocator to use when copy‐constructing a container. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#