BloombergLP::bslstp::Util::copyContainerAllocator

Return the allocator to use when copy-constructing a container.

Synopsis

Declared in <bslstp_util.h>

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.

Return Value

default allocator if ALLOCATOR uses bslma semantics; otherwise rhsAlloc unchanged

Parameters

NameDescription
rhsAllocallocator from the container being copied