[#BloombergLP-bslstp-Util-copyContainerAllocator]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstp.adoc[bslstp]::xref:BloombergLP/bslstp/Util.adoc[Util]::copyContainerAllocator
:relfileprefix: ../../../
:mrdocs:

Return the allocator to use when copy&hyphen;constructing a container&period;

== Synopsis

Declared in `&lt;bslstp&lowbar;util&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
ALLOCATOR
copyContainerAllocator(ALLOCATOR const& rhsAlloc);
----

== Description

`rhsAlloc` is intended to be the allocator from the container being copied&period; If the `ALLOCATOR` type uses `bslma` allocator semantics, then ignore `rhsAlloc` and return the default allocator&period; Otherwise, return `rhsAlloc` unchanged&period;


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