[#BloombergLP-bslma-AllocatorUtil-adapt-08]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil.adoc[AllocatorUtil]::adapt
:relfileprefix: ../../../
:mrdocs:

`adapt` overloads

== Synopses

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

Return the specified `from` allocator adapted to a type most likely to be usable for initializing another AA object&period; Specifically, return `from&period;mechanism()` if `from` is a specialization of `bsl&colon;&colon;allocator` (or a class derived from `bsl&colon;&colon;allocator`)&semi; otherwise return `from` unchanged&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ALLOC&gt;
static
t&lowbar;ALLOC
xref:BloombergLP/bslma/AllocatorUtil/adapt-03.adoc[adapt](t&lowbar;ALLOC const& from)
requires ! IsDerivedFromBslAllocator&lt;t&lowbar;ALLOC&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslma/AllocatorUtil/adapt-03.adoc[_» more&period;&period;&period;_]#

Return an allocator adapted from the specified `allocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
static
xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]*
xref:BloombergLP/bslma/AllocatorUtil/adapt-0f.adoc[adapt](xref:bsl/allocator-0df.adoc[bsl::allocator&lt;t&lowbar;TYPE&gt;] const& from);
----

[.small]#xref:BloombergLP/bslma/AllocatorUtil/adapt-0f.adoc[_» more&period;&period;&period;_]#


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