[#BloombergLP-bslma-AllocatorUtil_Traits-02]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::AllocatorUtil&lowbar;Traits
:relfileprefix: ../../
:mrdocs:

Traits extending `allocator&lowbar;traits` to pointer&hyphen;to&hyphen;memory&hyphen;resource types&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;ALLOCATOR,
    class t&lowbar;TYPE = char&gt;
struct AllocatorUtil&lowbar;Traits
    : bsl::allocator&lowbar;traits&lt;t&lowbar;ALLOCATOR&gt;::rebind&lowbar;traits&lt;t&lowbar;TYPE&gt;
----

== Description

Extend the notion of `allocator&lowbar;traits` to apply to both standard allocator and to pointer&hyphen;to&hyphen;memory&hyphen;resource types&period; If the (template parameter) `t&lowbar;ALLOCATOR` is a non&hyphen;pointer type (i&period;e&period;, an allocator class), then inherits from `bsl&colon;&colon;allocator&lowbar;traits&lt;t&lowbar;ALLOCATOR&gt;&colon;&colon;rebind&lowbar;traits&lt;t&lowbar;TYPE&gt;`&period; However, if `t&lowbar;ALLOCATOR` is a pointer type, then inherits from `bsl&colon;&colon;allocator&lowbar;traits&lt;bsl&colon;&colon;allocator&lt;t&lowbar;TYPE&gt;&gt;` for pointers to classes derived from `bslma&colon;&colon;Allocator` and from `bsl&colon;&colon;allocator&lowbar;traits&lt;bsl&colon;&colon;polymorphic&lowbar;allocator&lt;t&lowbar;TYPE&gt;&gt;` for pointers to other classes derived from `bsl&colon;&colon;memory&lowbar;resource`&period; This primary template is for non&hyphen;pointer `t&lowbar;ALLOCATOR` template arguments&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `bsl::allocator&lowbar;traits&lt;t&lowbar;ALLOCATOR&gt;::rebind&lowbar;traits&lt;t&lowbar;TYPE&gt;`
| 
|===

== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/AllocatorUtil_Traits-0f.adoc[`AllocatorUtil&lowbar;Traits&lt;t&lowbar;MEMORY&lowbar;RSRC*, t&lowbar;TYPE&gt;`] 
| Traits for an allocator expressed as a pointer to a memory resource&period;
|===



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