[#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‐constructing a container. == Synopsis Declared in `<bslstp_util.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> static ALLOCATOR copyContainerAllocator(ALLOCATOR const& rhsAlloc); ---- == Description `rhsAlloc` is intended to be the allocator from the container being copied. If the `ALLOCATOR` type uses `bslma` allocator semantics, then ignore `rhsAlloc` and return the default allocator. Otherwise, return `rhsAlloc` unchanged. [.small]#Created with https://www.mrdocs.com[MrDocs]#