11#ifndef INCLUDED_BSLMA_POLYMORPHICALLOCATOR_CPP03
12#define INCLUDED_BSLMA_POLYMORPHICALLOCATOR_CPP03
63#ifdef COMPILING_BSLMA_POLYMORPHICALLOCATOR_H
65#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
68# include <memory_resource>
73template <
class TYPE = std::
byte>
74using polymorphic_allocator = std::pmr::polymorphic_allocator<TYPE>;
94#if defined(BSLS_PLATFORM_CMP_MSVC)
110struct PolymorphicAllocator_Unique
115#define BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(VAL_T) \
116 std::pmr::polymorphic_allocator< \
117 BloombergLP::bslma::PolymorphicAllocator_Unique>
121#define BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(VAL_T) \
122 typename bsl::type_identity<std::pmr::polymorphic_allocator<VAL_T>>::type
133bool operator==(
const polymorphic_allocator<TYPE>& a,
134 const BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(TYPE)& b)
140bool operator==(
const BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(TYPE)& a,
141 const polymorphic_allocator<TYPE>& b)
147bool operator!=(
const polymorphic_allocator<TYPE>& a,
148 const BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(TYPE)& b)
154bool operator!=(
const BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(TYPE)& a,
155 const polymorphic_allocator<TYPE>& b)
177template <
class TYPE =
unsigned char>
178class polymorphic_allocator {
181 memory_resource *d_resource;
202 template <
class ANY_TYPE>
204 typedef polymorphic_allocator<ANY_TYPE>
other;
236#ifdef BSLS_COMPILERFEATURES_SUPPORT_DEFAULTED_FUNCTIONS
243 template<
class ANY_TYPE>
258#ifndef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
283 template <
class ELEMENT_TYPE>
299#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
302#ifndef BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT
303#define BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT 14
305#ifndef BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A
306#define BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT
308#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 0
309 template <
class ELEMENT_TYPE,
class ARG1>
314#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 1
315 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01>
321#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 2
322 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
330#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 3
331 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
341#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 4
342 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
354#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 5
355 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
369#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 6
370 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
386#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 7
387 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
405#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 8
406 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
426#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 9
427 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
449#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 10
450 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
474#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 11
475 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
501#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 12
502 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
530#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 13
531 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
561#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 14
562 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
594#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 0
595 template <
class ELEMENT_TYPE,
class ARG1>
600#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 1
601 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01>
607#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 2
608 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
616#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 3
617 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
627#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 4
628 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
640#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 5
641 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
655#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 6
656 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
672#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 7
673 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
691#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 8
692 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
712#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 9
713 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
735#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 10
736 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
760#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 11
761 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
787#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 12
788 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
816#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 13
817 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
847#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_A >= 14
848 template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
883 template <
class ELEMENT_TYPE,
class ARG1,
class... ARGS>
887 template <
class ELEMENT_TYPE,
class ARG1,
class... ARGS>
896 template <
class ELEMENT_TYPE>
935 return a.resource() == b.resource() || *a.resource() == *b.resource();
952 return a.resource() != b.resource() && *a.resource() != *b.resource();
963template <
class T1,
class T2>
964bool operator==(
const polymorphic_allocator<T1>& a,
972template <
class T1,
class T2>
973bool operator!=(
const polymorphic_allocator<T1>& a,
991struct allocator_traits<polymorphic_allocator<TYPE> > {
1004#ifdef BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES
1005 template <
class TYPE2>
1006 using rebind_alloc = polymorphic_allocator<TYPE2>;
1008 template <
class TYPE2>
1009 using rebind_traits = allocator_traits<polymorphic_allocator<TYPE2> >;
1011 template <
class TYPE2>
1012 struct rebind_alloc : polymorphic_allocator<TYPE2> {
1014 : polymorphic_allocator<TYPE2>()
1021 template <
typename ARG>
1023 : polymorphic_allocator<TYPE2>(allocatorArg)
1028 template <
class TYPE2>
1029 struct rebind_traits : allocator_traits<polymorphic_allocator<TYPE2> > {
1035 return m.allocate(n);
1042 return m.allocate(n);
1050 template <
class TYPE2>
1057#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1060#ifndef BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT
1061#define BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT 14
1063#ifndef BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B
1064#define BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT
1066#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 0
1067 template <
class TYPE2,
class ARG1>
1077#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 1
1078 template <
class TYPE2,
class ARG1,
class ARGS_01>
1090#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 2
1091 template <
class TYPE2,
class ARG1,
class ARGS_01,
1106#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 3
1107 template <
class TYPE2,
class ARG1,
class ARGS_01,
1125#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 4
1126 template <
class TYPE2,
class ARG1,
class ARGS_01,
1147#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 5
1148 template <
class TYPE2,
class ARG1,
class ARGS_01,
1172#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 6
1173 template <
class TYPE2,
class ARG1,
class ARGS_01,
1200#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 7
1201 template <
class TYPE2,
class ARG1,
class ARGS_01,
1231#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 8
1232 template <
class TYPE2,
class ARG1,
class ARGS_01,
1265#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 9
1266 template <
class TYPE2,
class ARG1,
class ARGS_01,
1302#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 10
1303 template <
class TYPE2,
class ARG1,
class ARGS_01,
1342#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 11
1343 template <
class TYPE2,
class ARG1,
class ARGS_01,
1385#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 12
1386 template <
class TYPE2,
class ARG1,
class ARGS_01,
1431#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 13
1432 template <
class TYPE2,
class ARG1,
class ARGS_01,
1480#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 14
1481 template <
class TYPE2,
class ARG1,
class ARGS_01,
1533#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 0
1534 template <
class TYPE2,
class ARG1>
1544#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 1
1545 template <
class TYPE2,
class ARG1,
class ARGS_01>
1557#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 2
1558 template <
class TYPE2,
class ARG1,
class ARGS_01,
1573#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 3
1574 template <
class TYPE2,
class ARG1,
class ARGS_01,
1592#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 4
1593 template <
class TYPE2,
class ARG1,
class ARGS_01,
1614#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 5
1615 template <
class TYPE2,
class ARG1,
class ARGS_01,
1639#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 6
1640 template <
class TYPE2,
class ARG1,
class ARGS_01,
1667#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 7
1668 template <
class TYPE2,
class ARG1,
class ARGS_01,
1698#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 8
1699 template <
class TYPE2,
class ARG1,
class ARGS_01,
1732#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 9
1733 template <
class TYPE2,
class ARG1,
class ARGS_01,
1769#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 10
1770 template <
class TYPE2,
class ARG1,
class ARGS_01,
1809#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 11
1810 template <
class TYPE2,
class ARG1,
class ARGS_01,
1852#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 12
1853 template <
class TYPE2,
class ARG1,
class ARGS_01,
1898#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 13
1899 template <
class TYPE2,
class ARG1,
class ARGS_01,
1947#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_B >= 14
1948 template <
class TYPE2,
class ARG1,
class ARGS_01,
2002 template <
class TYPE2,
class ARG1,
class... ARGS>
2013 template <
class TYPE2,
class ARG1,
class... ARGS>
2026 template <
class TYPE2>
2067template <
class TYPE>
2068struct is_trivially_copyable<polymorphic_allocator<TYPE> > :
true_type { };
2076template <
class TYPE>
2084template <
class TYPE>
2093template <
class TYPE>
2100#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
2109template <
class TYPE>
2111bool std::pmr::operator==(
const std::pmr::polymorphic_allocator<TYPE>& a,
2112 const BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(TYPE)& b)
2115 return a.resource() == b.resource() || *a.resource() == *b.resource();
2118template <
class TYPE>
2120bool std::pmr::operator==(
const BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(TYPE)& a,
2121 const std::pmr::polymorphic_allocator<TYPE>& b)
2124 return a.resource() == b.resource() || *a.resource() == *b.resource();
2127template <
class TYPE>
2129bool std::pmr::operator!=(
const std::pmr::polymorphic_allocator<TYPE>& a,
2130 const BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(TYPE)& b)
2133 return a.resource() != b.resource() && *a.resource() != *b.resource();
2136template <
class TYPE>
2138bool std::pmr::operator!=(
const BSLMF_POLYMORPHICALLOCATOR_NODEDUCE_T(TYPE)& a,
2139 const std::pmr::polymorphic_allocator<TYPE>& b)
2142 return a.resource() != b.resource() && *a.resource() != *b.resource();
2154template <
class TYPE>
2156: d_resource(BloombergLP::
bslma::Default::defaultAllocator())
2160template <
class TYPE>
2168#ifndef BSLS_COMPILERFEATURES_SUPPORT_DEFAULTED_FUNCTIONS
2170template <
class TYPE>
2172polymorphic_allocator<TYPE>::
2174: d_resource(other.resource())
2179template <
class TYPE>
2180template<
class ANY_TYPE>
2182polymorphic_allocator<TYPE>::
2183polymorphic_allocator(
const polymorphic_allocator<ANY_TYPE>& other)
2185: d_resource(other.resource())
2190template <
class TYPE>
2192TYPE *polymorphic_allocator<TYPE>::allocate(std::size_t n)
2194 const size_t k_TYPE_ALIGNMENT =
2195 BloombergLP::bsls::AlignmentFromType<TYPE>::VALUE;
2197 if (n > this->max_size()) {
2198 BloombergLP::bsls::BslExceptionUtil::throwBadAlloc();
2201 return static_cast<TYPE *
>(d_resource->allocate(n *
sizeof(TYPE),
2205#ifndef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
2206template <
class TYPE>
2209polymorphic_allocator<TYPE>::allocate(std::size_t n,
const void * )
2211 return this->allocate(n);
2215template <
class TYPE>
2217void polymorphic_allocator<TYPE>::deallocate(TYPE *p, std::size_t n)
2219 const std::size_t k_TYPE_ALIGNMENT =
2220 BloombergLP::bsls::AlignmentFromType<TYPE>::VALUE;
2222 d_resource->deallocate(p, n *
sizeof(TYPE), k_TYPE_ALIGNMENT);
2225template <
class TYPE>
2226template <
class ELEMENT_TYPE>
2228void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address)
2230 BloombergLP::bslma::ConstructionUtil::construct(address, *
this);
2233#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2236#ifndef BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT
2237#define BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT 14
2239#ifndef BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C
2240#define BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT
2242#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 0
2243template <
class TYPE>
2244template <
class ELEMENT_TYPE,
class ARG1>
2246void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2249 BloombergLP::bslma::ConstructionUtil::construct(
2256#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 1
2257template <
class TYPE>
2258template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01>
2260void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2264 BloombergLP::bslma::ConstructionUtil::construct(
2272#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 2
2273template <
class TYPE>
2274template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2277void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2282 BloombergLP::bslma::ConstructionUtil::construct(
2291#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 3
2292template <
class TYPE>
2293template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2297void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2303 BloombergLP::bslma::ConstructionUtil::construct(
2313#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 4
2314template <
class TYPE>
2315template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2320void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2327 BloombergLP::bslma::ConstructionUtil::construct(
2338#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 5
2339template <
class TYPE>
2340template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2346void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2354 BloombergLP::bslma::ConstructionUtil::construct(
2366#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 6
2367template <
class TYPE>
2368template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2375void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2384 BloombergLP::bslma::ConstructionUtil::construct(
2397#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 7
2398template <
class TYPE>
2399template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2407void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2417 BloombergLP::bslma::ConstructionUtil::construct(
2431#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 8
2432template <
class TYPE>
2433template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2442void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2453 BloombergLP::bslma::ConstructionUtil::construct(
2468#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 9
2469template <
class TYPE>
2470template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2480void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2492 BloombergLP::bslma::ConstructionUtil::construct(
2508#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 10
2509template <
class TYPE>
2510template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2521void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2534 BloombergLP::bslma::ConstructionUtil::construct(
2551#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 11
2552template <
class TYPE>
2553template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2565void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2579 BloombergLP::bslma::ConstructionUtil::construct(
2597#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 12
2598template <
class TYPE>
2599template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2612void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2627 BloombergLP::bslma::ConstructionUtil::construct(
2646#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 13
2647template <
class TYPE>
2648template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2662void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2678 BloombergLP::bslma::ConstructionUtil::construct(
2698#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 14
2699template <
class TYPE>
2700template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2715void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
2732 BloombergLP::bslma::ConstructionUtil::construct(
2754#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 0
2755template <
class TYPE>
2756template <
class ELEMENT_TYPE,
class ARG1>
2758void polymorphic_allocator<TYPE>::construct(
2759 ELEMENT_TYPE *address,
2762 BloombergLP::bslma::ConstructionUtil::construct(
2769#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 1
2770template <
class TYPE>
2771template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01>
2773void polymorphic_allocator<TYPE>::construct(
2774 ELEMENT_TYPE *address,
2778 BloombergLP::bslma::ConstructionUtil::construct(
2786#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 2
2787template <
class TYPE>
2788template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2791void polymorphic_allocator<TYPE>::construct(
2792 ELEMENT_TYPE *address,
2797 BloombergLP::bslma::ConstructionUtil::construct(
2806#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 3
2807template <
class TYPE>
2808template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2812void polymorphic_allocator<TYPE>::construct(
2813 ELEMENT_TYPE *address,
2819 BloombergLP::bslma::ConstructionUtil::construct(
2829#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 4
2830template <
class TYPE>
2831template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2836void polymorphic_allocator<TYPE>::construct(
2837 ELEMENT_TYPE *address,
2844 BloombergLP::bslma::ConstructionUtil::construct(
2855#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 5
2856template <
class TYPE>
2857template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2863void polymorphic_allocator<TYPE>::construct(
2864 ELEMENT_TYPE *address,
2872 BloombergLP::bslma::ConstructionUtil::construct(
2884#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 6
2885template <
class TYPE>
2886template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2893void polymorphic_allocator<TYPE>::construct(
2894 ELEMENT_TYPE *address,
2903 BloombergLP::bslma::ConstructionUtil::construct(
2916#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 7
2917template <
class TYPE>
2918template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2926void polymorphic_allocator<TYPE>::construct(
2927 ELEMENT_TYPE *address,
2937 BloombergLP::bslma::ConstructionUtil::construct(
2951#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 8
2952template <
class TYPE>
2953template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
2962void polymorphic_allocator<TYPE>::construct(
2963 ELEMENT_TYPE *address,
2974 BloombergLP::bslma::ConstructionUtil::construct(
2989#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 9
2990template <
class TYPE>
2991template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
3001void polymorphic_allocator<TYPE>::construct(
3002 ELEMENT_TYPE *address,
3014 BloombergLP::bslma::ConstructionUtil::construct(
3030#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 10
3031template <
class TYPE>
3032template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
3043void polymorphic_allocator<TYPE>::construct(
3044 ELEMENT_TYPE *address,
3057 BloombergLP::bslma::ConstructionUtil::construct(
3074#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 11
3075template <
class TYPE>
3076template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
3088void polymorphic_allocator<TYPE>::construct(
3089 ELEMENT_TYPE *address,
3103 BloombergLP::bslma::ConstructionUtil::construct(
3121#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 12
3122template <
class TYPE>
3123template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
3136void polymorphic_allocator<TYPE>::construct(
3137 ELEMENT_TYPE *address,
3152 BloombergLP::bslma::ConstructionUtil::construct(
3171#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 13
3172template <
class TYPE>
3173template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
3187void polymorphic_allocator<TYPE>::construct(
3188 ELEMENT_TYPE *address,
3204 BloombergLP::bslma::ConstructionUtil::construct(
3224#if BSLMA_POLYMORPHICALLOCATOR_VARIADIC_LIMIT_C >= 14
3225template <
class TYPE>
3226template <
class ELEMENT_TYPE,
class ARG1,
class ARGS_01,
3241void polymorphic_allocator<TYPE>::construct(
3242 ELEMENT_TYPE *address,
3259 BloombergLP::bslma::ConstructionUtil::construct(
3283template <
class TYPE>
3284template <
class ELEMENT_TYPE,
class ARG1,
class... ARGS>
3286void polymorphic_allocator<TYPE>::construct(ELEMENT_TYPE *address,
3290 BloombergLP::bslma::ConstructionUtil::construct(
3297template <
class TYPE>
3298template <
class ELEMENT_TYPE,
class ARG1,
class... ARGS>
3300void polymorphic_allocator<TYPE>::construct(
3301 ELEMENT_TYPE *address,
3305 BloombergLP::bslma::ConstructionUtil::construct(
3314template <
class TYPE>
3315template <
class ELEMENT_TYPE>
3317void polymorphic_allocator<TYPE>::destroy(ELEMENT_TYPE *address)
3319 BloombergLP::bslma::DestructionUtil::destroy(address);
3324template <
class TYPE>
3326typename polymorphic_allocator<TYPE>::pointer
3327polymorphic_allocator<TYPE>::address(reference x)
const
3329 return BloombergLP::bsls::Util::addressOf(x);
3332template <
class TYPE>
3334typename polymorphic_allocator<TYPE>::const_pointer
3335polymorphic_allocator<TYPE>::address(const_reference x)
const
3337 return BloombergLP::bsls::Util::addressOf(x);
3340template <
class TYPE>
3342typename polymorphic_allocator<TYPE>::size_type
3343polymorphic_allocator<TYPE>::max_size()
const
3348 return (~size_type(0)) /
sizeof(TYPE);
3351template <
class TYPE>
3353memory_resource *polymorphic_allocator<TYPE>::resource()
const
3358template <
class TYPE>
3360polymorphic_allocator<TYPE>
3361polymorphic_allocator<TYPE>::select_on_container_copy_construction()
const
3363 return polymorphic_allocator();
3369template <
class T1,
class T2>
3375 return a.resource() == b.resource() || *a.resource() == *b.resource();
3378template <
class T1,
class T2>
3384 return a.resource() != b.resource() && *a.resource() != *b.resource();
3390# error Not valid except when included from bslma_polymorphicallocator.h
Definition bslma_polymorphicallocator.h:452
friend bool operator==(const polymorphic_allocator &a, const polymorphic_allocator &b) BSLS_KEYWORD_NOEXCEPT
Definition bslma_polymorphicallocator.h:622
BSLS_ANNOTATION_NODISCARD TYPE * allocate(std::size_t n)
Definition bslma_polymorphicallocator.h:937
memory_resource * resource() const
Return the address of the memory resource supplied on construction.
Definition bslma_polymorphicallocator.h:1048
TYPE * pointer
Definition bslma_polymorphicallocator.h:465
friend bool operator!=(const polymorphic_allocator &a, const polymorphic_allocator &b) BSLS_KEYWORD_NOEXCEPT
Definition bslma_polymorphicallocator.h:639
void construct(ELEMENT_TYPE *address)
Definition bslma_polymorphicallocator.h:973
~polymorphic_allocator()=default
const TYPE * const_pointer
Definition bslma_polymorphicallocator.h:466
polymorphic_allocator() BSLS_KEYWORD_NOEXCEPT
Definition bslma_polymorphicallocator.h:900
std::ptrdiff_t difference_type
Definition bslma_polymorphicallocator.h:464
TYPE & reference
Definition bslma_polymorphicallocator.h:467
std::size_t size_type
Definition bslma_polymorphicallocator.h:463
BSLS_KEYWORD_CONSTEXPR size_type max_size() const
Definition bslma_polymorphicallocator.h:1038
polymorphic_allocator select_on_container_copy_construction() const
Return a default-constructed polymorphic_allocator.
Definition bslma_polymorphicallocator.h:1056
TYPE value_type
Definition bslma_polymorphicallocator.h:469
void deallocate(TYPE *p, std::size_t n)
Definition bslma_polymorphicallocator.h:962
const TYPE & const_reference
Definition bslma_polymorphicallocator.h:468
pointer address(reference x) const
Definition bslma_polymorphicallocator.h:1022
void destroy(ELEMENT_TYPE *address)
Definition bslma_polymorphicallocator.h:1012
#define BSLS_ANNOTATION_NODISCARD
Definition bsls_annotation.h:373
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#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_CONSTEXPR
Definition bsls_keyword.h:588
#define BSLS_KEYWORD_DELETED
Definition bsls_keyword.h:609
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
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
bool operator==(const memory_resource &a, const memory_resource &b)
bool operator!=(const memory_resource &a, const memory_resource &b)
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
rebind_alloc(const ARG &allocatorArg)
Definition bslma_allocatortraits.h:1193
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
polymorphic_allocator< ANY_TYPE > other
Definition bslma_polymorphicallocator.h:478