11#ifndef INCLUDED_BSLMA_ALLOCATORTRAITS_CPP03
12#define INCLUDED_BSLMA_ALLOCATORTRAITS_CPP03
63#ifdef COMPILING_BSLMA_ALLOCATORTRAITS_H
81struct AllocatorTraits_HasIsAlwaysEqual {
85 typedef struct {
char d_a; } yes_type;
86 typedef struct {
char d_a[2]; } no_type;
93 static yes_type match(
typename U::is_always_equal *);
95 static no_type match(...);
99 static const bool value =
sizeof(match<ALLOC>(0)) ==
sizeof(yes_type);
113template <class ALLOC, bool = AllocatorTraits_HasIsAlwaysEqual<ALLOC>::value>
114struct AllocatorTraits_IsAlwaysEqual :
public ALLOC::is_always_equal
122template <
class ALLOC>
123struct AllocatorTraits_IsAlwaysEqual<ALLOC, false>
139template <
class ALLOCATOR_TYPE>
140struct AllocatorTraits_HasSelectOnCopyMethod {
143 typedef struct {
char a; } yes_type;
144 typedef struct {
char a[2]; } no_type;
148 template <
class T, T>
struct MatchType { };
151 struct MethodAlias {
typedef T (T::*Method)() const; };
157 template <
class TYPE>
158 static yes_type match(MatchType<
typename MethodAlias<TYPE>::Method,
159 &TYPE::select_on_container_copy_construction> *);
160 template <
class TYPE>
161 static no_type match(...);
164 static const bool value =
165 sizeof(match<ALLOCATOR_TYPE>(0)) ==
sizeof(yes_type);
179template <
class ALLOCATOR_TYPE>
180struct AllocatorTraits_HasPropOnCopyAssign {
183 typedef struct {
char a; } yes_type;
184 typedef struct {
char a[2]; } no_type;
191 yes_type match(
typename U::propagate_on_container_copy_assignment *);
193 static no_type match(...);
196 static const bool value =
197 sizeof(match<ALLOCATOR_TYPE>(0)) ==
sizeof(yes_type);
210template <
class ALLOCATOR_TYPE,
221template <
class ALLOC>
222struct AllocatorTraits_PropOnCopyAssign<ALLOC, true>
223 :
public ALLOC::propagate_on_container_copy_assignment
237template <
class ALLOC>
238struct AllocatorTraits_HasPropOnMoveAssign {
241 typedef struct {
char a; } yes_type;
242 typedef struct {
char a[2]; } no_type;
249 yes_type match(
typename U::propagate_on_container_move_assignment *);
251 static no_type match(...);
254 static const bool value =
sizeof(match<ALLOC>(0)) ==
sizeof(yes_type);
267template <
class ALLOC,
278template <
class ALLOC>
279struct AllocatorTraits_PropOnMoveAssign<ALLOC, true>
280 :
public ALLOC::propagate_on_container_move_assignment
293template <
class ALLOC>
294struct AllocatorTraits_HasPropOnSwap {
297 typedef struct {
char a; } yes_type;
298 typedef struct {
char a[2]; } no_type;
305 yes_type match(
typename U::propagate_on_container_swap *);
307 static no_type match(...);
310 static const bool value =
sizeof(match<ALLOC>(0)) ==
sizeof(yes_type);
322template <class ALLOC, bool = AllocatorTraits_HasPropOnSwap<ALLOC>::value>
332template <
class ALLOC>
333struct AllocatorTraits_PropOnSwap<ALLOC, true>
334 :
public ALLOC::propagate_on_container_swap
338#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE) && \
339 defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \
340 defined(BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES)
346template <
class T,
class Return,
class... Args>
347struct AllocatorTraits_HasConstructMethod {
350 static auto match(U *) ->
352 bslmf::Util::declval<Args>()...)),
358 typedef decltype(match<T>(0)) type;
359 static const bool value = type::value;
366template <
class T,
class Return,
class... Args>
367struct AllocatorTraits_HasDestroyMethod {
370 static auto match(U *) ->
372 bslmf::Util::declval<Args>()...)),
378 typedef decltype(match<T>(0)) type;
379 static const bool value = type::value;
388template <
class T,
class =
void>
389struct AllocatorTraits_PointerType {
390 typedef typename T::value_type *
type;
395struct AllocatorTraits_PointerType<T,
BSLMF_VOIDTYPE(typename T::pointer)> {
396 typedef typename T::pointer
type;
403template <
class T,
class =
void>
404struct AllocatorTraits_ConstPointerType {
406 typedef const typename T::value_type *
type;
411struct AllocatorTraits_ConstPointerType<
414 typedef typename T::const_pointer
type;
422template <
class T,
class =
void>
423struct AllocatorTraits_VoidPointerType {
430struct AllocatorTraits_VoidPointerType<
433 typedef typename T::void_pointer
type;
440template <
class T,
class =
void>
441struct AllocatorTraits_ConstVoidPointerType {
443 typedef const void *
type;
448struct AllocatorTraits_ConstVoidPointerType<
451 typedef typename T::const_void_pointer
type;
458template <
class T,
class =
void>
459struct AllocatorTraits_SizeType {
460 typedef std::size_t
type;
465struct AllocatorTraits_SizeType<T,
BSLMF_VOIDTYPE(typename T::size_type)> {
466 typedef typename T::size_type
type;
474template <
class T,
class =
void>
475struct AllocatorTraits_DifferenceType {
476 typedef std::ptrdiff_t
type;
482struct AllocatorTraits_DifferenceType<
485 typedef typename T::difference_type
type;
492#if defined(BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES)
495template <
class T,
class U>
496struct AllocatorTraits_RebindFront {
499template <
template <
class,
class...>
class ALLOC,
503struct AllocatorTraits_RebindFront<ALLOC<T, ARGS...>, U> {
504 using type = ALLOC<U, ARGS...>;
507template <
class T,
class U>
508struct AllocatorTraits_RebindFront {
513template <
template <
class>
class ALLOC,
516struct AllocatorTraits_RebindFront<ALLOC<T>, U> {
517 typedef ALLOC<U> type;
526template <
class T,
class U,
class =
void>
527struct AllocatorTraits_RebindAlloc {
528 typedef typename AllocatorTraits_RebindFront<T, U>::type
type;
532template <
class T,
class U>
533struct AllocatorTraits_RebindAlloc<
537 typedef typename T::template rebind<U>::other
type;
544#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
545template <
class T,
class =
void>
546struct AllocatorTraits_CallMaxSize {
549 typedef typename AllocatorTraits_SizeType<T>::type SizeType;
556 static SizeType max_size(
const T &)
558 return std::numeric_limits<SizeType>::max() /
559 sizeof(
typename T::value_type);
567struct AllocatorTraits_CallMaxSize<
572 typedef typename AllocatorTraits_SizeType<T>::type SizeType;
579 static SizeType max_size(
const T &alloc)
581 return alloc.max_size();
612template <
class ALLOCATOR_TYPE>
613struct allocator_traits {
617 typedef typename BloombergLP::bslma::AllocatorTraits_HasSelectOnCopyMethod<
618 ALLOCATOR_TYPE>::type DelegateSelectMethod;
624 ALLOCATOR_TYPE selectOnCopyConstruct(
const ALLOCATOR_TYPE& stdAllocator,
631 ALLOCATOR_TYPE selectOnCopyConstruct(
const ALLOCATOR_TYPE& stdAllocator,
634#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE) && \
635 defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \
636 defined(BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES)
646 template <
class ELEMENT_TYPE,
class... Args>
648 BloombergLP::bslma::AllocatorTraits_HasConstructMethod<ALLOCATOR_TYPE,
653 privateConstruct(ALLOCATOR_TYPE& basicAllocator,
654 ELEMENT_TYPE *elementAddr,
655 Args&&... arguments);
656 template <
class ELEMENT_TYPE,
class... Args>
658 !BloombergLP::bslma::AllocatorTraits_HasConstructMethod<
664 privateConstruct(ALLOCATOR_TYPE& basicAllocator,
665 ELEMENT_TYPE *elementAddr,
666 Args&&... arguments);
668 template <
class ELEMENT_TYPE>
670 BloombergLP::bslma::AllocatorTraits_HasDestroyMethod<
673 ELEMENT_TYPE *>::value,
675 privateDestroy(ALLOCATOR_TYPE& basicAllocator, ELEMENT_TYPE *elementAddr);
684 template <
class ELEMENT_TYPE>
686 !BloombergLP::bslma::AllocatorTraits_HasDestroyMethod<
689 ELEMENT_TYPE *>::value,
691 privateDestroy(ALLOCATOR_TYPE& basicAllocator, ELEMENT_TYPE *elementAddr);
697 typedef typename ALLOCATOR_TYPE::value_type
value_type;
700 BloombergLP::bslma::AllocatorTraits_PointerType<ALLOCATOR_TYPE>::type
703 BloombergLP::bslma::AllocatorTraits_ConstPointerType<ALLOCATOR_TYPE>::type
706 BloombergLP::bslma::AllocatorTraits_VoidPointerType<ALLOCATOR_TYPE>::type
708 typedef typename BloombergLP::bslma::
709 AllocatorTraits_ConstVoidPointerType<ALLOCATOR_TYPE>::type
713 BloombergLP::bslma::AllocatorTraits_DifferenceType<ALLOCATOR_TYPE>::type
716 BloombergLP::bslma::AllocatorTraits_SizeType<ALLOCATOR_TYPE>::type
719#ifdef BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES
720 template <
class ELEMENT_TYPE>
721 using rebind_alloc =
typename
722 BloombergLP::bslma::AllocatorTraits_RebindAlloc<ALLOCATOR_TYPE,
725 template <
class ELEMENT_TYPE>
726 using rebind_traits = allocator_traits<rebind_alloc<ELEMENT_TYPE>>;
728 template <
class ELEMENT_TYPE>
730 : BloombergLP::bslma::AllocatorTraits_RebindAlloc<ALLOCATOR_TYPE,
740 typedef typename BloombergLP::bslma::
741 AllocatorTraits_RebindAlloc<ALLOCATOR_TYPE, ELEMENT_TYPE>::type
744 template <
typename ARG>
755 template <
class ELEMENT_TYPE>
756 struct rebind_traits : allocator_traits<typename allocator_traits::template
757 rebind_alloc<ELEMENT_TYPE>::allocator_type>
777 static void deallocate(ALLOCATOR_TYPE& basicAllocator,
783#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
786#ifndef BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT
787#define BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT 14
789#ifndef BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A
790#define BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT
793#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 0
794 template <
class ELEMENT_TYPE>
795 static void construct(ALLOCATOR_TYPE& basicAllocator,
796 ELEMENT_TYPE *elementAddr);
799#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 1
800 template <
class ELEMENT_TYPE,
class Args_01>
801 static void construct(ALLOCATOR_TYPE& basicAllocator,
802 ELEMENT_TYPE *elementAddr,
806#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 2
807 template <
class ELEMENT_TYPE,
class Args_01,
809 static void construct(ALLOCATOR_TYPE& basicAllocator,
810 ELEMENT_TYPE *elementAddr,
815#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 3
816 template <
class ELEMENT_TYPE,
class Args_01,
819 static void construct(ALLOCATOR_TYPE& basicAllocator,
820 ELEMENT_TYPE *elementAddr,
826#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 4
827 template <
class ELEMENT_TYPE,
class Args_01,
831 static void construct(ALLOCATOR_TYPE& basicAllocator,
832 ELEMENT_TYPE *elementAddr,
839#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 5
840 template <
class ELEMENT_TYPE,
class Args_01,
845 static void construct(ALLOCATOR_TYPE& basicAllocator,
846 ELEMENT_TYPE *elementAddr,
854#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 6
855 template <
class ELEMENT_TYPE,
class Args_01,
861 static void construct(ALLOCATOR_TYPE& basicAllocator,
862 ELEMENT_TYPE *elementAddr,
871#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 7
872 template <
class ELEMENT_TYPE,
class Args_01,
879 static void construct(ALLOCATOR_TYPE& basicAllocator,
880 ELEMENT_TYPE *elementAddr,
890#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 8
891 template <
class ELEMENT_TYPE,
class Args_01,
899 static void construct(ALLOCATOR_TYPE& basicAllocator,
900 ELEMENT_TYPE *elementAddr,
911#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 9
912 template <
class ELEMENT_TYPE,
class Args_01,
921 static void construct(ALLOCATOR_TYPE& basicAllocator,
922 ELEMENT_TYPE *elementAddr,
934#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 10
935 template <
class ELEMENT_TYPE,
class Args_01,
945 static void construct(ALLOCATOR_TYPE& basicAllocator,
946 ELEMENT_TYPE *elementAddr,
959#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 11
960 template <
class ELEMENT_TYPE,
class Args_01,
971 static void construct(ALLOCATOR_TYPE& basicAllocator,
972 ELEMENT_TYPE *elementAddr,
986#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 12
987 template <
class ELEMENT_TYPE,
class Args_01,
999 static void construct(ALLOCATOR_TYPE& basicAllocator,
1000 ELEMENT_TYPE *elementAddr,
1015#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 13
1016 template <
class ELEMENT_TYPE,
class Args_01,
1029 static void construct(ALLOCATOR_TYPE& basicAllocator,
1030 ELEMENT_TYPE *elementAddr,
1046#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_A >= 14
1047 template <
class ELEMENT_TYPE,
class Args_01,
1061 static void construct(ALLOCATOR_TYPE& basicAllocator,
1062 ELEMENT_TYPE *elementAddr,
1083 template <
class ELEMENT_TYPE,
class... Args>
1084 static void construct(ALLOCATOR_TYPE& basicAllocator,
1085 ELEMENT_TYPE *elementAddr,
1097 template <
class ELEMENT_TYPE>
1098 static void destroy(ALLOCATOR_TYPE& basicAllocator,
1099 ELEMENT_TYPE *elementAddr);
1121 static ALLOCATOR_TYPE
1129 typedef typename BloombergLP::bslma::AllocatorTraits_IsAlwaysEqual<
1138 typedef typename BloombergLP::bslma::AllocatorTraits_PropOnCopyAssign<
1147 typedef typename BloombergLP::bslma::AllocatorTraits_PropOnMoveAssign<
1156 typedef typename BloombergLP::bslma::AllocatorTraits_PropOnSwap<
1172template <
class ALLOCATOR_TYPE>
1173struct allocator_traits<ALLOCATOR_TYPE *> {
1190template <
class ALLOCATOR_TYPE>
1192ALLOCATOR_TYPE allocator_traits<ALLOCATOR_TYPE>::selectOnCopyConstruct(
1193 const ALLOCATOR_TYPE& stdAllocator,
1196 return stdAllocator.select_on_container_copy_construction();
1199template <
class ALLOCATOR_TYPE>
1201ALLOCATOR_TYPE allocator_traits<ALLOCATOR_TYPE>::selectOnCopyConstruct(
1202 const ALLOCATOR_TYPE& stdAllocator,
1205 return stdAllocator;
1208#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE) && \
1209 defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \
1210 defined(BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES)
1211template <
class ALLOCATOR_TYPE>
1212template <
class ELEMENT_TYPE,
class... Args>
1215 BloombergLP::bslma::AllocatorTraits_HasConstructMethod<ALLOCATOR_TYPE,
1220allocator_traits<ALLOCATOR_TYPE>::privateConstruct(
1221 ALLOCATOR_TYPE& basicAllocator,
1222 ELEMENT_TYPE *elementAddr,
1223 Args&&... arguments)
1225 basicAllocator.construct(
1229template <
class ALLOCATOR_TYPE>
1230template <
class ELEMENT_TYPE,
class... Args>
1233 !BloombergLP::bslma::AllocatorTraits_HasConstructMethod<ALLOCATOR_TYPE,
1238allocator_traits<ALLOCATOR_TYPE>::privateConstruct(ALLOCATOR_TYPE&,
1239 ELEMENT_TYPE *elementAddr,
1240 Args&&... arguments)
1242 ::new (
static_cast<void *
>(elementAddr))
1246template <
class ALLOCATOR_TYPE>
1247template <
class ELEMENT_TYPE>
1249typename bsl::enable_if<BloombergLP::bslma::AllocatorTraits_HasDestroyMethod<
1252 ELEMENT_TYPE *>::value,
1254allocator_traits<ALLOCATOR_TYPE>::privateDestroy(
1255 ALLOCATOR_TYPE& basicAllocator,
1256 ELEMENT_TYPE *elementAddr)
1258 basicAllocator.destroy(elementAddr);
1261template <
class ALLOCATOR_TYPE>
1262template <
class ELEMENT_TYPE>
1264typename bsl::enable_if<!BloombergLP::bslma::AllocatorTraits_HasDestroyMethod<
1267 ELEMENT_TYPE *>::value,
1269allocator_traits<ALLOCATOR_TYPE>::privateDestroy(ALLOCATOR_TYPE&,
1270 ELEMENT_TYPE *elementAddr)
1272 elementAddr->~ELEMENT_TYPE();
1278template <
class ALLOCATOR_TYPE>
1284 return basicAllocator.allocate(n);
1287template <
class ALLOCATOR_TYPE>
1292 const_void_pointer hint)
1294 return basicAllocator.allocate(n, hint);
1297template <
class ALLOCATOR_TYPE>
1301 pointer elementAddr,
1304 basicAllocator.deallocate(elementAddr, n);
1309#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1312#ifndef BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT
1313#define BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT 14
1315#ifndef BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B
1316#define BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT
1318#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 0
1319template <
class ALLOCATOR_TYPE>
1320template <
class ELEMENT_TYPE>
1324 ELEMENT_TYPE *elementAddr)
1326#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1327 privateConstruct(basicAllocator,
1330 basicAllocator.construct(
1336#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 1
1337template <
class ALLOCATOR_TYPE>
1338template <
class ELEMENT_TYPE,
class Args_01>
1342 ELEMENT_TYPE *elementAddr,
1345#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1346 privateConstruct(basicAllocator,
1350 basicAllocator.construct(
1356#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 2
1357template <
class ALLOCATOR_TYPE>
1358template <
class ELEMENT_TYPE,
class Args_01,
1363 ELEMENT_TYPE *elementAddr,
1367#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1368 privateConstruct(basicAllocator,
1373 basicAllocator.construct(
1380#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 3
1381template <
class ALLOCATOR_TYPE>
1382template <
class ELEMENT_TYPE,
class Args_01,
1388 ELEMENT_TYPE *elementAddr,
1393#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1394 privateConstruct(basicAllocator,
1400 basicAllocator.construct(
1408#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 4
1409template <
class ALLOCATOR_TYPE>
1410template <
class ELEMENT_TYPE,
class Args_01,
1417 ELEMENT_TYPE *elementAddr,
1423#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1424 privateConstruct(basicAllocator,
1431 basicAllocator.construct(
1440#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 5
1441template <
class ALLOCATOR_TYPE>
1442template <
class ELEMENT_TYPE,
class Args_01,
1450 ELEMENT_TYPE *elementAddr,
1457#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1458 privateConstruct(basicAllocator,
1466 basicAllocator.construct(
1476#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 6
1477template <
class ALLOCATOR_TYPE>
1478template <
class ELEMENT_TYPE,
class Args_01,
1487 ELEMENT_TYPE *elementAddr,
1495#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1496 privateConstruct(basicAllocator,
1505 basicAllocator.construct(
1516#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 7
1517template <
class ALLOCATOR_TYPE>
1518template <
class ELEMENT_TYPE,
class Args_01,
1528 ELEMENT_TYPE *elementAddr,
1537#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1538 privateConstruct(basicAllocator,
1548 basicAllocator.construct(
1560#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 8
1561template <
class ALLOCATOR_TYPE>
1562template <
class ELEMENT_TYPE,
class Args_01,
1573 ELEMENT_TYPE *elementAddr,
1583#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1584 privateConstruct(basicAllocator,
1595 basicAllocator.construct(
1608#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 9
1609template <
class ALLOCATOR_TYPE>
1610template <
class ELEMENT_TYPE,
class Args_01,
1622 ELEMENT_TYPE *elementAddr,
1633#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1634 privateConstruct(basicAllocator,
1646 basicAllocator.construct(
1660#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 10
1661template <
class ALLOCATOR_TYPE>
1662template <
class ELEMENT_TYPE,
class Args_01,
1675 ELEMENT_TYPE *elementAddr,
1687#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1688 privateConstruct(basicAllocator,
1701 basicAllocator.construct(
1716#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 11
1717template <
class ALLOCATOR_TYPE>
1718template <
class ELEMENT_TYPE,
class Args_01,
1732 ELEMENT_TYPE *elementAddr,
1745#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1746 privateConstruct(basicAllocator,
1760 basicAllocator.construct(
1776#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 12
1777template <
class ALLOCATOR_TYPE>
1778template <
class ELEMENT_TYPE,
class Args_01,
1793 ELEMENT_TYPE *elementAddr,
1807#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1808 privateConstruct(basicAllocator,
1823 basicAllocator.construct(
1840#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 13
1841template <
class ALLOCATOR_TYPE>
1842template <
class ELEMENT_TYPE,
class Args_01,
1858 ELEMENT_TYPE *elementAddr,
1873#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1874 privateConstruct(basicAllocator,
1890 basicAllocator.construct(
1908#if BSLMA_ALLOCATORTRAITS_VARIADIC_LIMIT_B >= 14
1909template <
class ALLOCATOR_TYPE>
1910template <
class ELEMENT_TYPE,
class Args_01,
1927 ELEMENT_TYPE *elementAddr,
1943#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1944 privateConstruct(basicAllocator,
1961 basicAllocator.construct(
1983template <
class ALLOCATOR_TYPE>
1984template <
class ELEMENT_TYPE,
class... Args>
1988 ELEMENT_TYPE *elementAddr,
1991#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
1992 privateConstruct(basicAllocator,
1996 basicAllocator.construct(
2003template <
class ALLOCATOR_TYPE>
2004template <
class ELEMENT_TYPE>
2008 ELEMENT_TYPE *elementAddr)
2016#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE) && \
2017 defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
2018 privateDestroy(stdAllocator, elementAddr);
2020 elementAddr->~ELEMENT_TYPE();
2021 (void) stdAllocator;
2025template <
class ALLOCATOR_TYPE>
2031#if defined(BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE)
2032 return BloombergLP::bslma::
2033 AllocatorTraits_CallMaxSize<ALLOCATOR_TYPE>::max_size(basicAllocator);
2038 return basicAllocator.max_size();
2042template <
class ALLOCATOR_TYPE>
2046 const ALLOCATOR_TYPE& rhs)
2048 return selectOnCopyConstruct(rhs, DelegateSelectMethod());
2054# error Not valid except when included from bslma_allocatortraits.h
#define BSLMF_VOIDTYPE(ARG)
Definition bslmf_voidtype.h:335
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
Definition bdlb_printmethods.h:283
integral_constant< bool, false > false_type
Definition bslmf_integralconstant.h:297
integral_constant< bool, true > true_type
Definition bslmf_integralconstant.h:303
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
rebind_alloc(const ARG &allocatorArg)
Definition bslma_allocatortraits.h:1193
BloombergLP::bslma::AllocatorTraits_RebindAlloc< ALLOCATOR_TYPE, ELEMENT_TYPE >::type allocator_type
Definition bslma_allocatortraits.h:1190
static pointer allocate(ALLOCATOR_TYPE &basicAllocator, size_type n)
Return basicAllocator.allocate(n).
Definition bslma_allocatortraits.h:1439
BloombergLP::bslma::AllocatorTraits_ConstPointerType< ALLOCATOR_TYPE >::type const_pointer
Definition bslma_allocatortraits.h:1152
BloombergLP::bslma::AllocatorTraits_VoidPointerType< ALLOCATOR_TYPE >::type void_pointer
Definition bslma_allocatortraits.h:1155
BloombergLP::bslma::AllocatorTraits_PropOnCopyAssign< ALLOCATOR_TYPE >::type propagate_on_container_copy_assignment
Definition bslma_allocatortraits.h:1297
BloombergLP::bslma::AllocatorTraits_PropOnMoveAssign< ALLOCATOR_TYPE >::type propagate_on_container_move_assignment
Definition bslma_allocatortraits.h:1306
static ALLOCATOR_TYPE select_on_container_copy_construction(const ALLOCATOR_TYPE &rhs)
Definition bslma_allocatortraits.h:1532
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR_TYPE >::type size_type
Definition bslma_allocatortraits.h:1165
static void construct(ALLOCATOR_TYPE &basicAllocator, ELEMENT_TYPE *elementAddr, Args &&... arguments)
Definition bslma_allocatortraits.h:1472
static size_type max_size(const ALLOCATOR_TYPE &basicAllocator) BSLS_KEYWORD_NOEXCEPT
Definition bslma_allocatortraits.h:1515
BloombergLP::bslma::AllocatorTraits_PointerType< ALLOCATOR_TYPE >::type pointer
Definition bslma_allocatortraits.h:1149
static void destroy(ALLOCATOR_TYPE &basicAllocator, ELEMENT_TYPE *elementAddr)
Definition bslma_allocatortraits.h:1494
BloombergLP::bslma::AllocatorTraits_IsAlwaysEqual< ALLOCATOR_TYPE >::type is_always_equal
Definition bslma_allocatortraits.h:1288
static void deallocate(ALLOCATOR_TYPE &basicAllocator, pointer elementAddr, size_type n)
Definition bslma_allocatortraits.h:1458
BloombergLP::bslma::AllocatorTraits_PropOnSwap< ALLOCATOR_TYPE >::type propagate_on_container_swap
Definition bslma_allocatortraits.h:1315
ALLOCATOR_TYPE allocator_type
Definition bslma_allocatortraits.h:1144
BloombergLP::bslma::AllocatorTraits_ConstVoidPointerType< ALLOCATOR_TYPE >::type const_void_pointer
Definition bslma_allocatortraits.h:1158
BloombergLP::bslma::AllocatorTraits_DifferenceType< ALLOCATOR_TYPE >::type difference_type
Definition bslma_allocatortraits.h:1162
ALLOCATOR_TYPE::value_type value_type
Definition bslma_allocatortraits.h:1145
Definition bslmf_enableif.h:525
Definition bslmf_integralconstant.h:244
Definition bslmf_isempty.h:315
Definition bslmf_issame.h:146
const T::value_type * type
should be pointer_traits::rebind of template above
Definition bslma_allocatortraits.h:854
const void * type
should be pointer_traits::rebind of template above
Definition bslma_allocatortraits.h:891
std::ptrdiff_t type
Definition bslma_allocatortraits.h:924
static const bool value
Definition bslma_allocatortraits.h:547
bsl::integral_constant< bool, value > type
Definition bslma_allocatortraits.h:550
static const bool value
Definition bslma_allocatortraits.h:644
bsl::integral_constant< bool, value > type
Definition bslma_allocatortraits.h:646
bsl::integral_constant< bool, value > type
Definition bslma_allocatortraits.h:703
static const bool value
Definition bslma_allocatortraits.h:702
bsl::integral_constant< bool, value > type
Definition bslma_allocatortraits.h:759
static const bool value
Definition bslma_allocatortraits.h:758
bsl::integral_constant< bool, value > type
Definition bslma_allocatortraits.h:614
static const bool value
Definition bslma_allocatortraits.h:612
T::value_type * type
Definition bslma_allocatortraits.h:838
AllocatorTraits_RebindFront< T, U >::type type
Definition bslma_allocatortraits.h:976
std::size_t type
Definition bslma_allocatortraits.h:908
void * type
should be pointer_traits::rebind of template above
Definition bslma_allocatortraits.h:873