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

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;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ALLOC&gt;
static
t&lowbar;ALLOC
adapt(t&lowbar;ALLOC const& from)
requires ! IsDerivedFromBslAllocator&lt;t&lowbar;ALLOC&gt;&colon;&colon;value;
----


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