8#ifndef INCLUDED_BSLSTP_UTIL
9#define INCLUDED_BSLSTP_UTIL
61#include <bslscm_version.h>
85 template <
class ALLOCATOR,
int IS_BSLMA_ALLOC>
86 struct AllocatorUtil {
97 template <
class ALLOCATOR>
98 struct AllocatorUtil<ALLOCATOR, 0> {
116 template <
class ALLOCATOR>
128 template <
class CONTAINER,
class QUICKSWAP_FUNC>
131 const QUICKSWAP_FUNC& quickswap);
145template <
class ALLOCATOR,
int IS_BSLMA_ALLOC>
158template <
class ALLOCATOR>
173template <
class ALLOCATOR>
184template <
class CONTAINER,
class QUICKSWAP_FUNC>
187 const QUICKSWAP_FUNC& quickswap)
189 typedef typename CONTAINER::allocator_type allocator_type;
190 allocator_type alloc1 = c1.get_allocator();
191 allocator_type alloc2 = c2.get_allocator();
193 if (alloc1 == alloc2) {
200 CONTAINER c1copy(c1, alloc2);
201 CONTAINER c2copy(c2, alloc1);
205 quickswap(c1, c2copy);
206 quickswap(c2, c1copy);
212#ifndef BDE_OPENSOURCE_PUBLICATION
Definition bslstp_util.h:78
static ALLOCATOR copyContainerAllocator(const ALLOCATOR &rhsAlloc)
Definition bslstp_util.h:175
static void swapContainers(CONTAINER &c1, CONTAINER &c2, const QUICKSWAP_FUNC &quickswap)
Definition bslstp_util.h:185
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
bslstp::Util bslstp_Util
This alias is defined for backward compatibility.
Definition bslstp_util.h:218
static ALLOCATOR copyContainerAllocator(const ALLOCATOR &rhsAlloc)
Definition bslstp_util.h:148
Definition bslstp_exfunctional.h:325
Definition bslmf_isconvertible.h:875