11#ifndef INCLUDED_BSLTF_STDSTATEFULALLOCATOR_CPP03
12#define INCLUDED_BSLTF_STDSTATEFULALLOCATOR_CPP03
63#ifdef COMPILING_BSLTF_STDSTATEFULALLOCATOR_H
91 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION =
true,
92 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT =
true,
93 bool PROPAGATE_ON_CONTAINER_SWAP =
true,
94 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT =
true,
95 bool IS_ALWAYS_EQUAL =
false>
96class StdStatefulAllocator {
118#if !defined(BSLSTL_ALLOCATOR_TRAITS_SUPPORTS_ALL_CPP11_DEDUCTIONS)
126 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT>
133 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT>
146 template <
class BDE_OTHER_TYPE>
150 typedef StdStatefulAllocator<
152 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
153 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
154 PROPAGATE_ON_CONTAINER_SWAP,
155 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
156 IS_ALWAYS_EQUAL>
other;
171 template <
class BDE_OTHER_TYPE>
174 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
175 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
176 PROPAGATE_ON_CONTAINER_SWAP,
177 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
178 IS_ALWAYS_EQUAL>& original);
185 operator=(
const StdStatefulAllocator& rhs) =
default;
195#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
198#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
199#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT 14
201#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A
202#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
205#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 0
206 template <
class ELEMENT_TYPE>
210#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 1
211 template <
class ELEMENT_TYPE,
class Args_01>
216#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 2
217 template <
class ELEMENT_TYPE,
class Args_01,
224#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 3
225 template <
class ELEMENT_TYPE,
class Args_01,
234#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 4
235 template <
class ELEMENT_TYPE,
class Args_01,
246#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 5
247 template <
class ELEMENT_TYPE,
class Args_01,
260#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 6
261 template <
class ELEMENT_TYPE,
class Args_01,
276#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 7
277 template <
class ELEMENT_TYPE,
class Args_01,
294#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 8
295 template <
class ELEMENT_TYPE,
class Args_01,
314#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 9
315 template <
class ELEMENT_TYPE,
class Args_01,
336#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 10
337 template <
class ELEMENT_TYPE,
class Args_01,
360#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 11
361 template <
class ELEMENT_TYPE,
class Args_01,
386#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 12
387 template <
class ELEMENT_TYPE,
class Args_01,
414#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 13
415 template <
class ELEMENT_TYPE,
class Args_01,
444#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 14
445 template <
class ELEMENT_TYPE,
class Args_01,
480 template <
class ELEMENT_TYPE,
class... Args>
495 template <
class ELEMENT_TYPE>
496 void destroy(ELEMENT_TYPE *address);
499#if !defined(BSLSTL_ALLOCATOR_TRAITS_SUPPORTS_ALL_CPP11_DEDUCTIONS)
525template <
class TYPE1,
527 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
528 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
529 bool PROPAGATE_ON_CONTAINER_SWAP,
530 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
531 bool IS_ALWAYS_EQUAL>
534 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
535 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
536 PROPAGATE_ON_CONTAINER_SWAP,
537 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
538 IS_ALWAYS_EQUAL>& lhs,
539 const StdStatefulAllocator<
541 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
542 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
543 PROPAGATE_ON_CONTAINER_SWAP,
544 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
545 IS_ALWAYS_EQUAL>& rhs);
549template <
class TYPE1,
551 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
552 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
553 bool PROPAGATE_ON_CONTAINER_SWAP,
554 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
555 bool IS_ALWAYS_EQUAL>
558 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
559 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
560 PROPAGATE_ON_CONTAINER_SWAP,
561 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
562 IS_ALWAYS_EQUAL>& lhs,
563 const StdStatefulAllocator<
565 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
566 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
567 PROPAGATE_ON_CONTAINER_SWAP,
568 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
569 IS_ALWAYS_EQUAL>& rhs);
582 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
583 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
584 bool PROPAGATE_ON_CONTAINER_SWAP,
585 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
586 bool IS_ALWAYS_EQUAL>
588StdStatefulAllocator<TYPE,
589 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
590 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
591 PROPAGATE_ON_CONTAINER_SWAP,
592 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
595: d_allocator_p(
bslma::Default::allocator(allocator))
600 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
601 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
602 bool PROPAGATE_ON_CONTAINER_SWAP,
603 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
604 bool IS_ALWAYS_EQUAL>
605template <
class BDE_OTHER_TYPE>
607StdStatefulAllocator<TYPE,
608 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
609 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
610 PROPAGATE_ON_CONTAINER_SWAP,
611 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
613StdStatefulAllocator(
const StdStatefulAllocator<
615 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
616 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
617 PROPAGATE_ON_CONTAINER_SWAP,
618 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
619 IS_ALWAYS_EQUAL>& original)
620: d_allocator_p(original.allocator())
626 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
627 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
628 bool PROPAGATE_ON_CONTAINER_SWAP,
629 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
630 bool IS_ALWAYS_EQUAL>
633StdStatefulAllocator<TYPE,
634 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
635 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
636 PROPAGATE_ON_CONTAINER_SWAP,
637 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
638 IS_ALWAYS_EQUAL>::allocate(
641 if (numElements > this->max_size()) {
642 BloombergLP::bsls::BslExceptionUtil::throwBadAlloc();
645 return static_cast<TYPE *
>(d_allocator_p->
allocate(
649#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
652#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
653#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT 14
655#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B
656#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
658#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 0
660 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
661 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
662 bool PROPAGATE_ON_CONTAINER_SWAP,
663 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
664 bool IS_ALWAYS_EQUAL>
665template <
class ELEMENT_TYPE>
668StdStatefulAllocator<TYPE,
669 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
670 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
671 PROPAGATE_ON_CONTAINER_SWAP,
672 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
673 IS_ALWAYS_EQUAL>::construct(
674 ELEMENT_TYPE *address)
676 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
681#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 1
683 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
684 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
685 bool PROPAGATE_ON_CONTAINER_SWAP,
686 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
687 bool IS_ALWAYS_EQUAL>
688template <
class ELEMENT_TYPE,
class Args_01>
691StdStatefulAllocator<TYPE,
692 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
693 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
694 PROPAGATE_ON_CONTAINER_SWAP,
695 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
696 IS_ALWAYS_EQUAL>::construct(
697 ELEMENT_TYPE *address,
700 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
705#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 2
707 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
708 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
709 bool PROPAGATE_ON_CONTAINER_SWAP,
710 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
711 bool IS_ALWAYS_EQUAL>
712template <
class ELEMENT_TYPE,
class Args_01,
716StdStatefulAllocator<TYPE,
717 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
718 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
719 PROPAGATE_ON_CONTAINER_SWAP,
720 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
721 IS_ALWAYS_EQUAL>::construct(
722 ELEMENT_TYPE *address,
726 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
732#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 3
734 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
735 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
736 bool PROPAGATE_ON_CONTAINER_SWAP,
737 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
738 bool IS_ALWAYS_EQUAL>
739template <
class ELEMENT_TYPE,
class Args_01,
744StdStatefulAllocator<TYPE,
745 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
746 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
747 PROPAGATE_ON_CONTAINER_SWAP,
748 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
749 IS_ALWAYS_EQUAL>::construct(
750 ELEMENT_TYPE *address,
755 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
762#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 4
764 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
765 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
766 bool PROPAGATE_ON_CONTAINER_SWAP,
767 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
768 bool IS_ALWAYS_EQUAL>
769template <
class ELEMENT_TYPE,
class Args_01,
775StdStatefulAllocator<TYPE,
776 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
777 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
778 PROPAGATE_ON_CONTAINER_SWAP,
779 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
780 IS_ALWAYS_EQUAL>::construct(
781 ELEMENT_TYPE *address,
787 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
795#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 5
797 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
798 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
799 bool PROPAGATE_ON_CONTAINER_SWAP,
800 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
801 bool IS_ALWAYS_EQUAL>
802template <
class ELEMENT_TYPE,
class Args_01,
809StdStatefulAllocator<TYPE,
810 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
811 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
812 PROPAGATE_ON_CONTAINER_SWAP,
813 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
814 IS_ALWAYS_EQUAL>::construct(
815 ELEMENT_TYPE *address,
822 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
831#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 6
833 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
834 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
835 bool PROPAGATE_ON_CONTAINER_SWAP,
836 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
837 bool IS_ALWAYS_EQUAL>
838template <
class ELEMENT_TYPE,
class Args_01,
846StdStatefulAllocator<TYPE,
847 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
848 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
849 PROPAGATE_ON_CONTAINER_SWAP,
850 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
851 IS_ALWAYS_EQUAL>::construct(
852 ELEMENT_TYPE *address,
860 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
870#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 7
872 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
873 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
874 bool PROPAGATE_ON_CONTAINER_SWAP,
875 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
876 bool IS_ALWAYS_EQUAL>
877template <
class ELEMENT_TYPE,
class Args_01,
886StdStatefulAllocator<TYPE,
887 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
888 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
889 PROPAGATE_ON_CONTAINER_SWAP,
890 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
891 IS_ALWAYS_EQUAL>::construct(
892 ELEMENT_TYPE *address,
901 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
912#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 8
914 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
915 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
916 bool PROPAGATE_ON_CONTAINER_SWAP,
917 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
918 bool IS_ALWAYS_EQUAL>
919template <
class ELEMENT_TYPE,
class Args_01,
929StdStatefulAllocator<TYPE,
930 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
931 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
932 PROPAGATE_ON_CONTAINER_SWAP,
933 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
934 IS_ALWAYS_EQUAL>::construct(
935 ELEMENT_TYPE *address,
945 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
957#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 9
959 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
960 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
961 bool PROPAGATE_ON_CONTAINER_SWAP,
962 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
963 bool IS_ALWAYS_EQUAL>
964template <
class ELEMENT_TYPE,
class Args_01,
975StdStatefulAllocator<TYPE,
976 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
977 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
978 PROPAGATE_ON_CONTAINER_SWAP,
979 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
980 IS_ALWAYS_EQUAL>::construct(
981 ELEMENT_TYPE *address,
992 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
1005#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 10
1006template <
class TYPE,
1007 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1008 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1009 bool PROPAGATE_ON_CONTAINER_SWAP,
1010 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1011 bool IS_ALWAYS_EQUAL>
1012template <
class ELEMENT_TYPE,
class Args_01,
1024StdStatefulAllocator<TYPE,
1025 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1026 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1027 PROPAGATE_ON_CONTAINER_SWAP,
1028 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1029 IS_ALWAYS_EQUAL>::construct(
1030 ELEMENT_TYPE *address,
1042 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
1056#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 11
1057template <
class TYPE,
1058 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1059 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1060 bool PROPAGATE_ON_CONTAINER_SWAP,
1061 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1062 bool IS_ALWAYS_EQUAL>
1063template <
class ELEMENT_TYPE,
class Args_01,
1076StdStatefulAllocator<TYPE,
1077 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1078 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1079 PROPAGATE_ON_CONTAINER_SWAP,
1080 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1081 IS_ALWAYS_EQUAL>::construct(
1082 ELEMENT_TYPE *address,
1095 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
1110#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 12
1111template <
class TYPE,
1112 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1113 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1114 bool PROPAGATE_ON_CONTAINER_SWAP,
1115 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1116 bool IS_ALWAYS_EQUAL>
1117template <
class ELEMENT_TYPE,
class Args_01,
1131StdStatefulAllocator<TYPE,
1132 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1133 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1134 PROPAGATE_ON_CONTAINER_SWAP,
1135 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1136 IS_ALWAYS_EQUAL>::construct(
1137 ELEMENT_TYPE *address,
1151 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
1167#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 13
1168template <
class TYPE,
1169 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1170 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1171 bool PROPAGATE_ON_CONTAINER_SWAP,
1172 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1173 bool IS_ALWAYS_EQUAL>
1174template <
class ELEMENT_TYPE,
class Args_01,
1189StdStatefulAllocator<TYPE,
1190 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1191 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1192 PROPAGATE_ON_CONTAINER_SWAP,
1193 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1194 IS_ALWAYS_EQUAL>::construct(
1195 ELEMENT_TYPE *address,
1210 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
1227#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 14
1228template <
class TYPE,
1229 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1230 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1231 bool PROPAGATE_ON_CONTAINER_SWAP,
1232 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1233 bool IS_ALWAYS_EQUAL>
1234template <
class ELEMENT_TYPE,
class Args_01,
1250StdStatefulAllocator<TYPE,
1251 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1252 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1253 PROPAGATE_ON_CONTAINER_SWAP,
1254 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1255 IS_ALWAYS_EQUAL>::construct(
1256 ELEMENT_TYPE *address,
1272 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
1293template <
class TYPE,
1294 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1295 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1296 bool PROPAGATE_ON_CONTAINER_SWAP,
1297 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1298 bool IS_ALWAYS_EQUAL>
1299template <
class ELEMENT_TYPE,
class... Args>
1302StdStatefulAllocator<TYPE,
1303 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1304 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1305 PROPAGATE_ON_CONTAINER_SWAP,
1306 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1307 IS_ALWAYS_EQUAL>::construct(
1308 ELEMENT_TYPE *address,
1311 ::new (
static_cast<void*
>(address)) ELEMENT_TYPE(
1317template <
class TYPE,
1318 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1319 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1320 bool PROPAGATE_ON_CONTAINER_SWAP,
1321 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1322 bool IS_ALWAYS_EQUAL>
1324void StdStatefulAllocator<TYPE,
1325 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1326 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1327 PROPAGATE_ON_CONTAINER_SWAP,
1328 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1335template <
class TYPE,
1336 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1337 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1338 bool PROPAGATE_ON_CONTAINER_SWAP,
1339 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1340 bool IS_ALWAYS_EQUAL>
1341template <
class ELEMENT_TYPE>
1343void StdStatefulAllocator<TYPE,
1344 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1345 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1346 PROPAGATE_ON_CONTAINER_SWAP,
1347 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1348 IS_ALWAYS_EQUAL>::destroy(
1349 ELEMENT_TYPE * address)
1351 address->~ELEMENT_TYPE();
1354template <
class TYPE,
1355 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1356 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1357 bool PROPAGATE_ON_CONTAINER_SWAP,
1358 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1359 bool IS_ALWAYS_EQUAL>
1361typename StdStatefulAllocator<
1363 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1364 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1365 PROPAGATE_ON_CONTAINER_SWAP,
1366 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1367 IS_ALWAYS_EQUAL>::size_type
1368StdStatefulAllocator<TYPE,
1369 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1370 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1371 PROPAGATE_ON_CONTAINER_SWAP,
1372 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1384 std::size_t>::value));
1386 static const std::size_t MAX_NUM_BYTES =
~std::size_t(0);
1387 static const std::size_t MAX_NUM_ELEMENTS =
1388 std::size_t(MAX_NUM_BYTES) /
sizeof(TYPE);
1389 return MAX_NUM_ELEMENTS;
1392template <
class TYPE,
1393 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1394 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1395 bool PROPAGATE_ON_CONTAINER_SWAP,
1396 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1397 bool IS_ALWAYS_EQUAL>
1399StdStatefulAllocator<TYPE,
1400 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1401 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1402 PROPAGATE_ON_CONTAINER_SWAP,
1403 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1405StdStatefulAllocator<TYPE,
1406 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1407 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1408 PROPAGATE_ON_CONTAINER_SWAP,
1409 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1411select_on_container_copy_construction()
const
1413 if (PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION) {
1422template <
class TYPE,
1423 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1424 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1425 bool PROPAGATE_ON_CONTAINER_SWAP,
1426 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1427 bool IS_ALWAYS_EQUAL>
1430StdStatefulAllocator<TYPE,
1431 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1432 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1433 PROPAGATE_ON_CONTAINER_SWAP,
1434 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1438 return d_allocator_p;
1444template <
class TYPE1,
1446 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1447 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1448 bool PROPAGATE_ON_CONTAINER_SWAP,
1449 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1450 bool IS_ALWAYS_EQUAL>
1454 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1455 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1456 PROPAGATE_ON_CONTAINER_SWAP,
1457 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1458 IS_ALWAYS_EQUAL>& lhs,
1459 const StdStatefulAllocator<
1461 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1462 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1463 PROPAGATE_ON_CONTAINER_SWAP,
1464 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1465 IS_ALWAYS_EQUAL>& rhs)
1467 return IS_ALWAYS_EQUAL || (lhs.allocator() == rhs.allocator());
1470template <
class TYPE1,
1472 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1473 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1474 bool PROPAGATE_ON_CONTAINER_SWAP,
1475 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1476 bool IS_ALWAYS_EQUAL>
1480 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1481 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1482 PROPAGATE_ON_CONTAINER_SWAP,
1483 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1484 IS_ALWAYS_EQUAL>& lhs,
1485 const StdStatefulAllocator<
1487 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1488 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1489 PROPAGATE_ON_CONTAINER_SWAP,
1490 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1491 IS_ALWAYS_EQUAL>& rhs)
1493 return !IS_ALWAYS_EQUAL && (lhs.allocator() != rhs.allocator());
1499# error Not valid except when included from bsltf_stdstatefulallocator.h
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
Definition bslma_allocator.h:457
virtual void deallocate(void *address)=0
std::size_t size_type
Definition bslma_allocator.h:499
virtual void * allocate(size_type size)=0
std::ptrdiff_t difference_type
Definition bsltf_stdstatefulallocator.h:257
bslma::Allocator * allocator() const
Return the address of the allocator wrapped by this object.
Definition bsltf_stdstatefulallocator.h:648
bsl::integral_constant< bool, PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT > propagate_on_container_move_assignment
Definition bsltf_stdstatefulallocator.h:271
StdStatefulAllocator select_on_container_copy_construction() const
Definition bsltf_stdstatefulallocator.h:623
TYPE * allocate(bslma::Allocator::size_type numElements)
Definition bsltf_stdstatefulallocator.h:495
bsl::integral_constant< bool, PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT > propagate_on_container_copy_assignment
Definition bsltf_stdstatefulallocator.h:264
const TYPE * const_pointer
Definition bsltf_stdstatefulallocator.h:259
~StdStatefulAllocator()=default
std::size_t size_type
Definition bsltf_stdstatefulallocator.h:256
TYPE value_type
Definition bsltf_stdstatefulallocator.h:246
bsl::integral_constant< bool, PROPAGATE_ON_CONTAINER_SWAP > propagate_on_container_swap
Definition bsltf_stdstatefulallocator.h:267
void destroy(ELEMENT_TYPE *address)
Definition bsltf_stdstatefulallocator.h:560
void construct(ELEMENT_TYPE *address, Args &&... arguments)
Definition bsltf_stdstatefulallocator.h:521
StdStatefulAllocator & operator=(const StdStatefulAllocator &rhs)=default
bsl::integral_constant< bool, IS_ALWAYS_EQUAL > is_always_equal
Definition bsltf_stdstatefulallocator.h:275
void deallocate(TYPE *address, bslma::Allocator::size_type numElements)
Definition bsltf_stdstatefulallocator.h:542
StdStatefulAllocator(bslma::Allocator *allocator=0)
Definition bsltf_stdstatefulallocator.h:451
size_type max_size() const
Definition bsltf_stdstatefulallocator.h:586
TYPE * pointer
Definition bsltf_stdstatefulallocator.h:258
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
Definition balxml_encoderoptions.h:68
Definition bsltf_allocargumenttype.h:92
bool operator!=(const AllocBitwiseMoveableTestType &lhs, const AllocBitwiseMoveableTestType &rhs)
bool operator==(const AllocBitwiseMoveableTestType &lhs, const AllocBitwiseMoveableTestType &rhs)
Definition bdldfp_decimal.h:5188
Definition bslmf_integralconstant.h:244
Definition bslmf_issame.h:146
static Allocator * defaultAllocator()
Definition bslma_default.h:889
Definition bslma_isstdallocator.h:201
StdStatefulAllocator< BDE_OTHER_TYPE, PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION, PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT, PROPAGATE_ON_CONTAINER_SWAP, PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT, IS_ALWAYS_EQUAL > other
Definition bsltf_stdstatefulallocator.h:293