BDE 4.14.0 Production release
|
#include <bslstp_util.h>
Static Public Member Functions | |
template<class ALLOCATOR > | |
static ALLOCATOR | copyContainerAllocator (const ALLOCATOR &rhsAlloc) |
template<class CONTAINER , class QUICKSWAP_FUNC > | |
static void | swapContainers (CONTAINER &c1, CONTAINER &c2, const QUICKSWAP_FUNC &quickswap) |
Namespace for utility functions used to implement STL functionality.
See bslstp_util
|
inlinestatic |
Return the appropriate allocator for use when copy-constructing a container. 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.
|
static |
Swap the contents of containers c1
and c2
, correctly handling the case where the two containers have different allocator values. The quickswap
argument is a binary function object that is called to quickly swap two CONTAINER
objects with matching allocators. (The quickswap
object does not need to check that the allocator matched – it is guaranteed by the caller.) Strong exception guarantee: if the allocator or copy constructor of either container throws an exception, then the values of c1
and c2
are left unchanged. The quickswap
function must not throw an exception.