[#BloombergLP-bslma-AllocatorUtil_Traits-0f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil_Traits-02.adoc[AllocatorUtil&lowbar;Traits]&lt;t&lowbar;MEMORY&lowbar;RSRC*, t&lowbar;TYPE&gt;
:relfileprefix: ../../
:mrdocs:

Traits for an allocator expressed as a pointer to a memory resource&period;

== Synopsis

Declared in `&lt;bslma&lowbar;allocatorutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;MEMORY&lowbar;RSRC,
    class t&lowbar;TYPE&gt;
struct xref:BloombergLP/bslma/AllocatorUtil_Traits-02.adoc[AllocatorUtil&lowbar;Traits]&lt;t&lowbar;MEMORY&lowbar;RSRC*, t&lowbar;TYPE&gt;
    : xref:bsl/allocator_traits-0108.adoc[bsl::allocator&lowbar;traits&lt;bsl::conditional&lt;bsl&colon;&colon;is&lowbar;convertible&lt;t&lowbar;MEMORY&lowbar;RSRC &ast;, bslma&colon;&colon;Allocator &ast;&gt;&colon;&colon;value, bsl::allocator&lt;t&lowbar;TYPE&gt;, bsl::polymorphic&lowbar;allocator&lt;t&lowbar;TYPE&gt;&gt;::type&gt;]
----

== Description

This specialization is for allocators expressed as a pointer to class derived from `bsl&colon;&colon;memory&lowbar;resource`&period; The base class will be `bsl&colon;&colon;allocator&lowbar;traits&lt;bsl&colon;&colon;allocator&lt;t&lowbar;TYPE&gt;&gt;` if `t&lowbar;MEMORY&lowbar;RSRC` is derived from `bsl&colon;&colon;Allocator`&semi; otherwise the base class will be `bsl&colon;&colon;allocator&lowbar;traits&lt;bsl&colon;&colon;polymorphic&lowbar;allocator&lt;t&lowbar;TYPE&gt;&gt;`&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/allocator_traits-0108.adoc[bsl::allocator&lowbar;traits&lt;bsl::conditional&lt;bsl&colon;&colon;is&lowbar;convertible&lt;t&lowbar;MEMORY&lowbar;RSRC &ast;, bslma&colon;&colon;Allocator &ast;&gt;&colon;&colon;value, bsl::allocator&lt;t&lowbar;TYPE&gt;, bsl::polymorphic&lowbar;allocator&lt;t&lowbar;TYPE&gt;&gt;::type&gt;]`
| Uniform interface to nested types and operations of any allocator&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/allocator_traits-0108/allocator_type.adoc[`allocator&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `ALLOCATOR&lowbar;TYPE`&period;
| xref:bsl/allocator_traits-0108/const_pointer.adoc[`const&lowbar;pointer`] 
| This `typedef` is an alias to `AllocatorTraits&lowbar;ConstPointerType&lt;ALLOCATOR&lowbar;TYPE&gt;&colon;&colon;type`&period;
| xref:bsl/allocator_traits-0108/const_void_pointer.adoc[`const&lowbar;void&lowbar;pointer`] 
| Const void pointer type for the allocator&period;
| xref:bsl/allocator_traits-0108/difference_type.adoc[`difference&lowbar;type`] 
| This `typedef` is an alias to `AllocatorTraits&lowbar;DifferenceType&lt;ALLOCATOR&lowbar;TYPE&gt;&colon;&colon;type`&period;
| xref:bsl/allocator_traits-0108/is_always_equal.adoc[`is&lowbar;always&lowbar;equal`] 
| `true&lowbar;type` if two allocators always compare equal&semi; else `false&lowbar;type`&period;
| xref:bsl/allocator_traits-0108/pointer.adoc[`pointer`] 
| This `typedef` is an alias to `AllocatorTraits&lowbar;PointerType&lt;ALLOCATOR&lowbar;TYPE&gt;&colon;&colon;type`&period;
| xref:bsl/allocator_traits-0108/propagate_on_container_copy_assignment.adoc[`propagate&lowbar;on&lowbar;container&lowbar;copy&lowbar;assignment`] 
| `true&lowbar;type` if the allocator propagates on copy assignment&period;
| xref:bsl/allocator_traits-0108/propagate_on_container_move_assignment.adoc[`propagate&lowbar;on&lowbar;container&lowbar;move&lowbar;assignment`] 
| `true&lowbar;type` if the allocator propagates on move assignment&period;
| xref:bsl/allocator_traits-0108/propagate_on_container_swap.adoc[`propagate&lowbar;on&lowbar;container&lowbar;swap`] 
| `true&lowbar;type` if the allocator propagates on container swap&period;
| xref:bsl/allocator_traits-0108/rebind_alloc.adoc[`rebind&lowbar;alloc`] 
| Rebind this allocator to the specified `ELEMENT&lowbar;TYPE`&period;
| xref:bsl/allocator_traits-0108/rebind_traits.adoc[`rebind&lowbar;traits`] 
| Rebind this allocator traits type to the specified `ELEMENT&lowbar;TYPE`&period;
| xref:bsl/allocator_traits-0108/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias to `AllocatorTraits&lowbar;SizeType&lt;ALLOCATOR&lowbar;TYPE&gt;&colon;&colon;type`&period;
| xref:bsl/allocator_traits-0108/value_type.adoc[`value&lowbar;type`] 
| This `typedef` is an alias to `ALLOCATOR&lowbar;TYPE&colon;&colon;value&lowbar;type`&period;
| xref:bsl/allocator_traits-0108/void_pointer.adoc[`void&lowbar;pointer`] 
| This `typedef` is an alias to `AllocatorTraits&lowbar;VoidPointerType&lt;ALLOCATOR&lowbar;TYPE&gt;&colon;&colon;type`&period;
|===


== 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&lowbar;TYPE` object at `elementAddr`&period;
| xref:bsl/allocator_traits-0108/deallocate.adoc[`deallocate`] 
| Deallocate the storage at `elementAddr` for `n` objects&period;
| xref:bsl/allocator_traits-0108/destroy.adoc[`destroy`] 
| Destroy the `ELEMENT&lowbar;TYPE` object at `elementAddr`&period;
| xref:bsl/allocator_traits-0108/max_size.adoc[`max&lowbar;size`] 
| Return the maximum number of objects `allocate` can return&period;
| xref:bsl/allocator_traits-0108/select_on_container_copy_construction.adoc[`select&lowbar;on&lowbar;container&lowbar;copy&lowbar;construction`] 
| Return the allocator to use when copy&hyphen;constructing a container&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
