8#ifndef INCLUDED_BSLSTP_UTIL
9#define INCLUDED_BSLSTP_UTIL
61#include <bslscm_version.h>
83 template <
class ALLOCATOR,
int IS_BSLMA_ALLOC>
84 struct AllocatorUtil {
95 template <
class ALLOCATOR>
96 struct AllocatorUtil<ALLOCATOR, 0> {
114 template <
class ALLOCATOR>
126 template <
class CONTAINER,
class QUICKSWAP_FUNC>
129 const QUICKSWAP_FUNC& quickswap);
143template <
class ALLOCATOR,
int IS_BSLMA_ALLOC>
156template <
class ALLOCATOR>
171template <
class ALLOCATOR>
182template <
class CONTAINER,
class QUICKSWAP_FUNC>
185 const QUICKSWAP_FUNC& quickswap)
187 typedef typename CONTAINER::allocator_type allocator_type;
188 allocator_type alloc1 = c1.get_allocator();
189 allocator_type alloc2 = c2.get_allocator();
191 if (alloc1 == alloc2) {
198 CONTAINER c1copy(c1, alloc2);
199 CONTAINER c2copy(c2, alloc1);
203 quickswap(c1, c2copy);
204 quickswap(c2, c1copy);
210#ifndef BDE_OPENSOURCE_PUBLICATION
Definition bslstp_util.h:78
static ALLOCATOR copyContainerAllocator(const ALLOCATOR &rhsAlloc)
Definition bslstp_util.h:173
static void swapContainers(CONTAINER &c1, CONTAINER &c2, const QUICKSWAP_FUNC &quickswap)
Definition bslstp_util.h:183
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
bslstp::Util bslstp_Util
This alias is defined for backward compatibility.
Definition bslstp_util.h:216
static ALLOCATOR copyContainerAllocator(const ALLOCATOR &rhsAlloc)
Definition bslstp_util.h:146
Definition bslstp_exfunctional.h:323
Definition bslmf_isconvertible.h:867