11#ifndef INCLUDED_BDLMA_LOCALBUFFEREDOBJECT_CPP03
12#define INCLUDED_BDLMA_LOCALBUFFEREDOBJECT_CPP03
63#ifdef COMPILING_BDLMA_LOCALBUFFEREDOBJECT_H
65#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
66#define BDLMA_LOCAL_BUFFERED_VALUE_IS_ASSIGNABLE(DST, SRC) \
67 std::is_assignable<DST, SRC>::value
69#define BDLMA_LOCAL_BUFFERED_VALUE_IS_ASSIGNABLE(DST, SRC) true
88template <
class t_TYPE,
89 bsl::size_t t_BUFFER_SIZE = 1024,
90 bool t_DISABLE_DESTRUCTION =
false>
91class LocalBufferedObject {
112 LocalBufferedObject& operator=(
const LocalBufferedObject&)
119 void destroyHeldObject();
124 BloombergLP::bslmf::UsesAllocatorArgT);
127#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
130#ifndef BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT
131#define BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT 10
133#ifndef BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A
134#define BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT
136#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 0
137 explicit LocalBufferedObject(
141#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 1
142 template <
class ARGS_01>
143 explicit LocalBufferedObject(
147#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 2
148 template <
class ARGS_01,
150 explicit LocalBufferedObject(
155#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 3
156 template <
class ARGS_01,
159 explicit LocalBufferedObject(
165#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 4
166 template <
class ARGS_01,
170 explicit LocalBufferedObject(
177#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 5
178 template <
class ARGS_01,
183 explicit LocalBufferedObject(
191#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 6
192 template <
class ARGS_01,
198 explicit LocalBufferedObject(
207#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 7
208 template <
class ARGS_01,
215 explicit LocalBufferedObject(
225#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 8
226 template <
class ARGS_01,
234 explicit LocalBufferedObject(
245#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 9
246 template <
class ARGS_01,
255 explicit LocalBufferedObject(
267#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 10
268 template <
class ARGS_01,
278 explicit LocalBufferedObject(
292#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 0
293 LocalBufferedObject(bsl::allocator_arg_t ,
297#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 1
298 template <
class ARGS_01>
299 LocalBufferedObject(bsl::allocator_arg_t ,
304#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 2
305 template <
class ARGS_01,
307 LocalBufferedObject(bsl::allocator_arg_t ,
313#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 3
314 template <
class ARGS_01,
317 LocalBufferedObject(bsl::allocator_arg_t ,
324#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 4
325 template <
class ARGS_01,
329 LocalBufferedObject(bsl::allocator_arg_t ,
337#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 5
338 template <
class ARGS_01,
343 LocalBufferedObject(bsl::allocator_arg_t ,
352#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 6
353 template <
class ARGS_01,
359 LocalBufferedObject(bsl::allocator_arg_t ,
369#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 7
370 template <
class ARGS_01,
377 LocalBufferedObject(bsl::allocator_arg_t ,
388#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 8
389 template <
class ARGS_01,
397 LocalBufferedObject(bsl::allocator_arg_t ,
409#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 9
410 template <
class ARGS_01,
419 LocalBufferedObject(bsl::allocator_arg_t ,
432#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_A >= 10
433 template <
class ARGS_01,
443 LocalBufferedObject(bsl::allocator_arg_t ,
460 template <
class... ARGS>
461 explicit LocalBufferedObject(
464 template <
class... ARGS>
465 LocalBufferedObject(bsl::allocator_arg_t ,
471#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
477 template <
class INIT_LIST_TYPE>
478 LocalBufferedObject(std::initializer_list<INIT_LIST_TYPE> il);
485 template <
class INIT_LIST_TYPE>
486 LocalBufferedObject(bsl::allocator_arg_t ,
488 std::initializer_list<INIT_LIST_TYPE> il);
502 template <
class t_ANY_TYPE>
506 LocalBufferedObject>::type&
518#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
521#ifndef BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT
522#define BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT 10
524#ifndef BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C
525#define BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT
527#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 0
531#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 1
532 template <
class ARGS_01>
536#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 2
537 template <
class ARGS_01,
543#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 3
544 template <
class ARGS_01,
552#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 4
553 template <
class ARGS_01,
563#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 5
564 template <
class ARGS_01,
576#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 6
577 template <
class ARGS_01,
591#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 7
592 template <
class ARGS_01,
608#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 8
609 template <
class ARGS_01,
627#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 9
628 template <
class ARGS_01,
648#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_C >= 10
649 template <
class ARGS_01,
674 template <
class... ARGS>
679#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
684 template <
class INIT_LIST_TYPE>
685 void emplace(std::initializer_list<INIT_LIST_TYPE> il);
714template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
716void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
719 if (!t_DISABLE_DESTRUCTION) {
720 d_object.
address()->~value_type();
725#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
728#ifndef BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT
729#define BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT 10
731#ifndef BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D
732#define BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT
734#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 0
735template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
737LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
738 LocalBufferedObject()
747#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 1
748template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
749template <
class ARGS_01>
751LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
762#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 2
763template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
764template <
class ARGS_01,
767LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
780#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 3
781template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
782template <
class ARGS_01,
786LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
801#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 4
802template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
803template <
class ARGS_01,
808LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
825#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 5
826template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
827template <
class ARGS_01,
833LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
852#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 6
853template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
854template <
class ARGS_01,
861LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
882#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 7
883template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
884template <
class ARGS_01,
892LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
915#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 8
916template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
917template <
class ARGS_01,
926LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
951#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 9
952template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
953template <
class ARGS_01,
963LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
990#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 10
991template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
992template <
class ARGS_01,
1003LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1033#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 0
1034template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1036LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1037 LocalBufferedObject(bsl::allocator_arg_t ,
1039: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1047#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 1
1048template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1049template <
class ARGS_01>
1051LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1052 LocalBufferedObject(bsl::allocator_arg_t ,
1055: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1064#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 2
1065template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1066template <
class ARGS_01,
1069LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1070 LocalBufferedObject(bsl::allocator_arg_t ,
1074: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1084#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 3
1085template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1086template <
class ARGS_01,
1090LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1091 LocalBufferedObject(bsl::allocator_arg_t ,
1096: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1107#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 4
1108template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1109template <
class ARGS_01,
1114LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1115 LocalBufferedObject(bsl::allocator_arg_t ,
1121: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1133#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 5
1134template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1135template <
class ARGS_01,
1141LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1142 LocalBufferedObject(bsl::allocator_arg_t ,
1149: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1162#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 6
1163template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1164template <
class ARGS_01,
1171LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1172 LocalBufferedObject(bsl::allocator_arg_t ,
1180: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1194#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 7
1195template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1196template <
class ARGS_01,
1204LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1205 LocalBufferedObject(bsl::allocator_arg_t ,
1214: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1229#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 8
1230template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1231template <
class ARGS_01,
1240LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1241 LocalBufferedObject(bsl::allocator_arg_t ,
1251: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1267#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 9
1268template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1269template <
class ARGS_01,
1279LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1280 LocalBufferedObject(bsl::allocator_arg_t ,
1291: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1308#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_D >= 10
1309template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1310template <
class ARGS_01,
1321LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1322 LocalBufferedObject(bsl::allocator_arg_t ,
1334: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1355template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1356template <
class... ARGS>
1358LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1368template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1369template <
class... ARGS>
1371LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1372 LocalBufferedObject(bsl::allocator_arg_t ,
1375: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1385#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1386template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1387template <
class INIT_LIST_TYPE>
1389LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1390 LocalBufferedObject(std::initializer_list<INIT_LIST_TYPE> il)
1399template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1400template <
class INIT_LIST_TYPE>
1402LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1403 LocalBufferedObject(bsl::allocator_arg_t ,
1405 std::initializer_list<INIT_LIST_TYPE> il)
1406: d_arenaAllocator(
bslma::AllocatorUtil::adapt(allocator))
1415template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1417LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1418 ~LocalBufferedObject()
1420 destroyHeldObject();
1427template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1428template <
class t_ANY_TYPE>
1433 LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION> >::type&
1434LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::operator=(
1443template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1445t_TYPE *LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1451template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1453t_TYPE& LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1456 return d_object.
object();
1459#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1462#ifndef BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT
1463#define BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT 10
1465#ifndef BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F
1466#define BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT
1468#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 0
1469template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1470void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1473 destroyHeldObject();
1481#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 1
1482template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1483template <
class ARGS_01>
1484void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1488 destroyHeldObject();
1497#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 2
1498template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1499template <
class ARGS_01,
1501void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1506 destroyHeldObject();
1516#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 3
1517template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1518template <
class ARGS_01,
1521void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1527 destroyHeldObject();
1538#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 4
1539template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1540template <
class ARGS_01,
1544void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1551 destroyHeldObject();
1563#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 5
1564template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1565template <
class ARGS_01,
1570void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1578 destroyHeldObject();
1591#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 6
1592template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1593template <
class ARGS_01,
1599void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1608 destroyHeldObject();
1622#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 7
1623template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1624template <
class ARGS_01,
1631void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1641 destroyHeldObject();
1656#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 8
1657template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1658template <
class ARGS_01,
1666void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1677 destroyHeldObject();
1693#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 9
1694template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1695template <
class ARGS_01,
1704void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1716 destroyHeldObject();
1733#if BDLMA_LOCALBUFFEREDOBJECT_VARIADIC_LIMIT_F >= 10
1734template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1735template <
class ARGS_01,
1745void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1758 destroyHeldObject();
1779template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1780template <
class... ARGS>
1781void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1784 destroyHeldObject();
1794#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1795template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1796template <
class INIT_LIST_TYPE>
1797void LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1798 emplace(std::initializer_list<INIT_LIST_TYPE> il)
1800 destroyHeldObject();
1810template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1813LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1819template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1822LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1825 return d_object.
object();
1828template <
class t_TYPE, bsl::
size_t t_BUFFER_SIZE,
bool t_DISABLE_DESTRUCTION>
1831LocalBufferedObject<t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION>::
1832 get_allocator()
const
1834 return allocator_type(d_arenaAllocator.
allocator());
1837#undef BDLMA_LOCAL_BUFFERED_VALUE_IS_ASSIGNABLE
1843# error Not valid except when included from bdlma_localbufferedobject.h
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
bslma::Allocator * allocator() const
Return the allocator passed at construction.
Definition bdlma_bufferedsequentialallocator.h:531
void release() BSLS_KEYWORD_OVERRIDE
Definition bdlma_bufferedsequentialallocator.h:518
t_TYPE value_type
Definition bdlma_localbufferedobject.h:267
value_type & operator*()
Definition bdlma_localbufferedobject.h:517
~LocalBufferedObject()
Definition bdlma_localbufferedobject.h:482
allocator_type get_allocator() const
Definition bdlma_localbufferedobject.h:575
value_type * operator->()
Definition bdlma_localbufferedobject.h:509
void emplace(BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args)
Definition bdlma_localbufferedobject.h:526
bsl::allocator allocator_type
Definition bdlma_localbufferedobject.h:268
@ k_BUFFER_SIZE
Definition bdlma_localbufferedobject.h:270
Definition bdlma_localsequentialallocator.h:230
Definition bslma_bslallocator.h:580
#define BDLMA_LOCAL_BUFFERED_VALUE_IS_ASSIGNABLE(DST, SRC)
Definition bdlma_localbufferedobject.h:236
#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
#define BSLS_KEYWORD_DELETED
Definition bsls_keyword.h:609
Definition bdlma_alignedallocator.h:276
Definition balxml_encoderoptions.h:68
Definition bslmf_enableif.h:525
static bsl::enable_if<!IsDerivedFromBslAllocator< t_ALLOC >::value, t_ALLOC >::type adapt(const t_ALLOC &from)
Definition bslma_allocatorutil.h:856
static void construct(TARGET_TYPE *address, const ALLOCATOR &allocator)
Definition bslma_constructionutil.h:1243
Definition bslma_usesbslmaallocator.h:343
Definition bsls_objectbuffer.h:276
TYPE * address()
Definition bsls_objectbuffer.h:334
TYPE & object()
Definition bsls_objectbuffer.h:351