BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsltf_stdstatefulallocator_cpp03.h
Go to the documentation of this file.
1/// @file bsltf_stdstatefulallocator_cpp03.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bsltf_stdstatefulallocator_cpp03.h -*-C++-*-
8
9// Automatically generated file. **DO NOT EDIT**
10
11#ifndef INCLUDED_BSLTF_STDSTATEFULALLOCATOR_CPP03
12#define INCLUDED_BSLTF_STDSTATEFULALLOCATOR_CPP03
13
14/// @defgroup bsltf_stdstatefulallocator_cpp03 bsltf_stdstatefulallocator_cpp03
15/// @brief Provide C++03 implementation for bsltf_stdstatefulallocator.h
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bsltf
19/// @{
20/// @addtogroup bsltf_stdstatefulallocator_cpp03
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bsltf_stdstatefulallocator_cpp03-purpose"> Purpose</a>
25/// * <a href="#bsltf_stdstatefulallocator_cpp03-classes"> Classes </a>
26/// * <a href="#bsltf_stdstatefulallocator_cpp03-description"> Description </a>
27///
28/// # Purpose {#bsltf_stdstatefulallocator_cpp03-purpose}
29/// Provide C++03 implementation for bsltf_stdstatefulallocator.h
30///
31/// # Classes {#bsltf_stdstatefulallocator_cpp03-classes}
32/// See bsltf_stdstatefulallocator.h for list of classes
33///
34/// @see bsltf_stdstatefulallocator
35///
36/// # Description {#bsltf_stdstatefulallocator_cpp03-description}
37/// This component is the C++03 translation of a C++11 component,
38/// generated by the 'sim_cpp11_features.pl' program. If the original header
39/// contains any specially delimited regions of C++11 code, then this generated
40/// file contains the C++03 equivalent, i.e., with variadic templates expanded
41/// and rvalue-references replaced by 'bslmf::MovableRef' objects. The header
42/// code in this file is designed to be '#include'd into the original header
43/// when compiling with a C++03 compiler. If there are no specially delimited
44/// regions of C++11 code, then this header contains no code and is not
45/// '#include'd in the original header.
46///
47/// Generated on Sun Sep 1 05:38:52 2024
48/// Command line: sim_cpp11_features.pl bsltf_stdstatefulallocator.h
49/// @}
50/** @} */
51/** @} */
52
53/** @addtogroup bsl
54 * @{
55 */
56/** @addtogroup bsltf
57 * @{
58 */
59/** @addtogroup bsltf_stdstatefulallocator_cpp03
60 * @{
61 */
62
63#ifdef COMPILING_BSLTF_STDSTATEFULALLOCATOR_H
64
65
66namespace bsltf {
67
68 // ==========================
69 // class StdStatefulAllocator
70 // ==========================
71
72/// This allocator implements the minimal interface to comply with section
73/// 17.6.3.5 ([allocator.requirements]) of the C++11 standard, while
74/// maintaining a distinct object state - in this case a wrapped pointer to
75/// a `bslma::Allocator`. The template is configurable to control its
76/// allocator propagation properties, but does not support the BDE "scoped"
77/// allocator model, as scoped allocators should never propagate. Instances
78/// of this allocator delegate their operations to the wrapped allocator
79/// that constitutes its state. Note that while we define the various
80/// traits used by the C++11 allocator traits facility, they actually mean
81/// very little for this component, as it is the consumer of the allocator's
82/// responsibility to check and apply the traits correctly, typically by
83/// using `bsl::allocator_traits` to perform all memory allocation tasks
84/// rather than using the allocator directly. The
85/// `PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION` flag is consumed directly
86/// though, in the static member function
87/// `select_on_container_copy_construction`.
88///
89/// See @ref bsltf_stdstatefulallocator_cpp03
90template <class TYPE,
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 {
97
98 private:
99 // DATA
100 bslma::Allocator *d_allocator_p; // the wrapped allocator (held, not
101 // owned)
102
103 public:
104 // TRAITS
105 BSLMF_NESTED_TRAIT_DECLARATION(StdStatefulAllocator,
107
108 // PUBLIC TYPES
109 typedef TYPE value_type;
110
111 // For a minimal allocator, these should all be deducible for a C++11
112 // container implementation. Unfortunately, the C++03 implementation of
113 // 'allocator_traits' supported by BDE does not try the leaps of template
114 // metaprogramming necessary to deduce these types. That is left for a
115 // future C++11 implementation, where language makes such metaprograms
116 // much simpler to write.
117
118#if !defined(BSLSTL_ALLOCATOR_TRAITS_SUPPORTS_ALL_CPP11_DEDUCTIONS)
119 typedef std::size_t size_type;
120 typedef std::ptrdiff_t difference_type;
121 typedef TYPE *pointer;
122 typedef const TYPE *const_pointer;
123#endif
124
125 typedef bsl::integral_constant<bool,
126 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT>
128
131
132 typedef bsl::integral_constant<bool,
133 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT>
135
136 typedef bsl::integral_constant<bool,
137 IS_ALWAYS_EQUAL>
139
140 /// This nested `struct` template, parameterized by some
141 /// `BDE_OTHER_TYPE`, provides a namespace for an `other` type alias,
142 /// which is an allocator type following the same template as this one
143 /// but that allocates elements of `BDE_OTHER_TYPE`. Note that this
144 /// allocator type is convertible to and from `other` for any
145 /// `BDE_OTHER_TYPE` including `void`.
146 template <class BDE_OTHER_TYPE>
147 struct rebind
148 {
149
150 typedef StdStatefulAllocator<
151 BDE_OTHER_TYPE,
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;
157 };
158
159 // CREATORS
160
161 /// Create a `StdStatefulAllocator` object wrapping the specified
162 /// `allocator`.
164
165 StdStatefulAllocator(const StdStatefulAllocator& original) = default;
166 // Create an allocator having the same value as the specified
167 // 'original' object.
168
169 /// Create a `StdStatefulAllocator` object wrapping the same test
170 /// allocator as the specified `original`.
171 template <class BDE_OTHER_TYPE>
172 StdStatefulAllocator(const StdStatefulAllocator<
173 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);
179
180 ~StdStatefulAllocator() = default;
181 // Destroy this object.
182
183 // MANIPULATORS
185 operator=(const StdStatefulAllocator& rhs) = default;
186 // Assign to this object the value of the specified 'rhs' object, and
187 // return a reference providing modifiable access to this object.
188
189 /// Allocate enough (properly aligned) space for the specified
190 /// `numElements` of the (template parameter) type `TYPE`. If the
191 /// underlying `bslma::Allocator` is unable to fulfill the allocation
192 /// request, an exception (typically `bsl::bad_alloc`) will be thrown.
193 TYPE *allocate(bslma::Allocator::size_type numElements);
194
195#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
196// {{{ BEGIN GENERATED CODE
197// Command line: sim_cpp11_features.pl bsltf_stdstatefulallocator.h
198#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
199#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT 14
200#endif
201#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A
202#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
203#endif
204
205#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 0
206 template <class ELEMENT_TYPE>
207 void construct(ELEMENT_TYPE *address);
208#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 0
209
210#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 1
211 template <class ELEMENT_TYPE, class Args_01>
212 void construct(ELEMENT_TYPE *address,
213 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01);
214#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 1
215
216#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 2
217 template <class ELEMENT_TYPE, class Args_01,
218 class Args_02>
219 void construct(ELEMENT_TYPE *address,
220 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
221 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02);
222#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 2
223
224#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 3
225 template <class ELEMENT_TYPE, class Args_01,
226 class Args_02,
227 class Args_03>
228 void construct(ELEMENT_TYPE *address,
229 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
230 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
231 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03);
232#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 3
233
234#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 4
235 template <class ELEMENT_TYPE, class Args_01,
236 class Args_02,
237 class Args_03,
238 class Args_04>
239 void construct(ELEMENT_TYPE *address,
240 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
241 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
242 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
243 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04);
244#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 4
245
246#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 5
247 template <class ELEMENT_TYPE, class Args_01,
248 class Args_02,
249 class Args_03,
250 class Args_04,
251 class Args_05>
252 void construct(ELEMENT_TYPE *address,
253 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
254 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
255 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
256 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
257 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05);
258#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 5
259
260#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 6
261 template <class ELEMENT_TYPE, class Args_01,
262 class Args_02,
263 class Args_03,
264 class Args_04,
265 class Args_05,
266 class Args_06>
267 void construct(ELEMENT_TYPE *address,
268 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
269 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
270 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
271 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
272 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
273 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06);
274#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 6
275
276#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 7
277 template <class ELEMENT_TYPE, class Args_01,
278 class Args_02,
279 class Args_03,
280 class Args_04,
281 class Args_05,
282 class Args_06,
283 class Args_07>
284 void construct(ELEMENT_TYPE *address,
285 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
286 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
287 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
288 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
289 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
290 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
291 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07);
292#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 7
293
294#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 8
295 template <class ELEMENT_TYPE, class Args_01,
296 class Args_02,
297 class Args_03,
298 class Args_04,
299 class Args_05,
300 class Args_06,
301 class Args_07,
302 class Args_08>
303 void construct(ELEMENT_TYPE *address,
304 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
305 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
306 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
307 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
308 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
309 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
310 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
311 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08);
312#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 8
313
314#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 9
315 template <class ELEMENT_TYPE, class Args_01,
316 class Args_02,
317 class Args_03,
318 class Args_04,
319 class Args_05,
320 class Args_06,
321 class Args_07,
322 class Args_08,
323 class Args_09>
324 void construct(ELEMENT_TYPE *address,
325 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
326 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
327 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
328 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
329 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
330 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
331 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
332 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
333 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09);
334#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 9
335
336#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 10
337 template <class ELEMENT_TYPE, class Args_01,
338 class Args_02,
339 class Args_03,
340 class Args_04,
341 class Args_05,
342 class Args_06,
343 class Args_07,
344 class Args_08,
345 class Args_09,
346 class Args_10>
347 void construct(ELEMENT_TYPE *address,
348 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
349 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
350 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
351 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
352 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
353 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
354 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
355 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
356 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
357 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10);
358#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 10
359
360#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 11
361 template <class ELEMENT_TYPE, class Args_01,
362 class Args_02,
363 class Args_03,
364 class Args_04,
365 class Args_05,
366 class Args_06,
367 class Args_07,
368 class Args_08,
369 class Args_09,
370 class Args_10,
371 class Args_11>
372 void construct(ELEMENT_TYPE *address,
373 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
374 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
375 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
376 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
377 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
378 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
379 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
380 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
381 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
382 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
383 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11);
384#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 11
385
386#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 12
387 template <class ELEMENT_TYPE, class Args_01,
388 class Args_02,
389 class Args_03,
390 class Args_04,
391 class Args_05,
392 class Args_06,
393 class Args_07,
394 class Args_08,
395 class Args_09,
396 class Args_10,
397 class Args_11,
398 class Args_12>
399 void construct(ELEMENT_TYPE *address,
400 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
401 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
402 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
403 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
404 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
405 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
406 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
407 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
408 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
409 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
410 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
411 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12);
412#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 12
413
414#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 13
415 template <class ELEMENT_TYPE, class Args_01,
416 class Args_02,
417 class Args_03,
418 class Args_04,
419 class Args_05,
420 class Args_06,
421 class Args_07,
422 class Args_08,
423 class Args_09,
424 class Args_10,
425 class Args_11,
426 class Args_12,
427 class Args_13>
428 void construct(ELEMENT_TYPE *address,
429 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
430 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
431 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
432 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
433 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
434 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
435 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
436 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
437 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
438 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
439 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
440 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12,
441 BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13);
442#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 13
443
444#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 14
445 template <class ELEMENT_TYPE, class Args_01,
446 class Args_02,
447 class Args_03,
448 class Args_04,
449 class Args_05,
450 class Args_06,
451 class Args_07,
452 class Args_08,
453 class Args_09,
454 class Args_10,
455 class Args_11,
456 class Args_12,
457 class Args_13,
458 class Args_14>
459 void construct(ELEMENT_TYPE *address,
460 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
461 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
462 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
463 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
464 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
465 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
466 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
467 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
468 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
469 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
470 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
471 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12,
472 BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13,
473 BSLS_COMPILERFEATURES_FORWARD_REF(Args_14) arguments_14);
474#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 14
475
476#else
477// The generated code below is a workaround for the absence of perfect
478// forwarding in some compilers.
479
480 template <class ELEMENT_TYPE, class... Args>
481 void construct(ELEMENT_TYPE *address,
482 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... arguments);
483// }}} END GENERATED CODE
484#endif
485
486 /// Return memory previously allocated at the specified `address` for
487 /// `numElements` back to this allocator. The `numElements` argument is
488 /// ignored by this allocator type. The behavior is undefined unless
489 /// `address` was allocated using this allocator object and has not
490 /// already been deallocated.
491 void deallocate(TYPE *address, bslma::Allocator::size_type numElements);
492
493 /// Invoke the `ELEMENT_TYPE` destructor for the object at the specified
494 /// `address`.
495 template <class ELEMENT_TYPE>
496 void destroy(ELEMENT_TYPE *address);
497
498 // ACCESSORS
499#if !defined(BSLSTL_ALLOCATOR_TRAITS_SUPPORTS_ALL_CPP11_DEDUCTIONS)
500 /// Return the maximum number of elements of type `TYPE` that can be
501 /// allocated using this allocator in a single call to the `allocate`
502 /// method. Note that there is no guarantee that attempts at allocating
503 /// less elements than the value returned by @ref max_size will not throw.
504 /// *** DO NOT RELY ON THE CONTINUING PRESENT OF THIS METHOD *** THIS
505 /// METHOD WILL BE REMOVED ONCE `bslstl::allocator_traits` PROPERLY
506 /// DEDUCES AN IMPLEMENTATION FOR THIS FUNCTION WHEN NOT SUPPLIED BY THE
507 /// ALLOCATOR DIRECTLY.
508 size_type max_size() const;
509#endif
510
511 /// Return a copy of this object if the `bool` template parameter
512 /// `PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION` is true, and a copy of a
513 /// `StdStatefulAllocator` object wrapping the default allocator
514 /// otherwise.
516
517 /// Return the address of the allocator wrapped by this object.
519};
520
521// FREE OPERATORS
522
523/// Return `true` if the specified `lhs` and `rhs` have the same underlying
524/// test allocator, and `false` otherwise.
525template <class TYPE1,
526 class TYPE2,
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>
532bool operator==(const StdStatefulAllocator<
533 TYPE1,
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<
540 TYPE2,
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);
546
547/// Return `true` if the specified `lhs` and `rhs` have different underlying
548/// test allocators, and `false` otherwise.
549template <class TYPE1,
550 class TYPE2,
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>
556bool operator!=(const StdStatefulAllocator<
557 TYPE1,
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<
564 TYPE2,
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);
570
571
572// ============================================================================
573// INLINE DEFINITIONS
574// ============================================================================
575
576 // --------------------------
577 // class StdStatefulAllocator
578 // --------------------------
579
580// CREATORS
581template <class TYPE,
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>
587inline
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,
593 IS_ALWAYS_EQUAL>::
594StdStatefulAllocator(bslma::Allocator *allocator)
595: d_allocator_p(bslma::Default::allocator(allocator))
596{
597}
598
599template <class TYPE,
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>
606inline
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,
612 IS_ALWAYS_EQUAL>::
613StdStatefulAllocator(const StdStatefulAllocator<
614 BDE_OTHER_TYPE,
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())
621{
622}
623
624// MANIPULATORS
625template <class TYPE,
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>
631inline
632TYPE *
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(
639 bslma::Allocator::size_type numElements)
640{
641 if (numElements > this->max_size()) {
642 BloombergLP::bsls::BslExceptionUtil::throwBadAlloc();
643 }
644
645 return static_cast<TYPE *>(d_allocator_p->allocate(
646 bslma::Allocator::size_type(numElements * sizeof(TYPE))));
647}
648
649#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
650// {{{ BEGIN GENERATED CODE
651// Command line: sim_cpp11_features.pl bsltf_stdstatefulallocator.h
652#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
653#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT 14
654#endif
655#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B
656#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
657#endif
658#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 0
659template <class TYPE,
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>
666inline
667void
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)
675{
676 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
677 );
678}
679#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 0
680
681#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 1
682template <class TYPE,
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>
689inline
690void
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,
698 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01)
699{
700 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
701 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01));
702}
703#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 1
704
705#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 2
706template <class TYPE,
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,
713 class Args_02>
714inline
715void
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,
723 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
724 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02)
725{
726 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
727 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
728 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02));
729}
730#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 2
731
732#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 3
733template <class TYPE,
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,
740 class Args_02,
741 class Args_03>
742inline
743void
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,
751 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
752 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
753 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03)
754{
755 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
756 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
757 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
758 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03));
759}
760#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 3
761
762#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 4
763template <class TYPE,
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,
770 class Args_02,
771 class Args_03,
772 class Args_04>
773inline
774void
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,
782 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
783 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
784 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
785 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04)
786{
787 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
788 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
789 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
790 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
791 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04));
792}
793#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 4
794
795#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 5
796template <class TYPE,
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,
803 class Args_02,
804 class Args_03,
805 class Args_04,
806 class Args_05>
807inline
808void
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,
816 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
817 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
818 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
819 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
820 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05)
821{
822 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
823 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
824 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
825 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
826 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
827 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05));
828}
829#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 5
830
831#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 6
832template <class TYPE,
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,
839 class Args_02,
840 class Args_03,
841 class Args_04,
842 class Args_05,
843 class Args_06>
844inline
845void
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,
853 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
854 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
855 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
856 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
857 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
858 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06)
859{
860 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
861 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
862 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
863 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
864 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
865 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
866 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06));
867}
868#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 6
869
870#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 7
871template <class TYPE,
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,
878 class Args_02,
879 class Args_03,
880 class Args_04,
881 class Args_05,
882 class Args_06,
883 class Args_07>
884inline
885void
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,
893 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
894 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
895 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
896 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
897 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
898 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
899 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07)
900{
901 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
902 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
903 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
904 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
905 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
906 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
907 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
908 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07));
909}
910#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 7
911
912#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 8
913template <class TYPE,
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,
920 class Args_02,
921 class Args_03,
922 class Args_04,
923 class Args_05,
924 class Args_06,
925 class Args_07,
926 class Args_08>
927inline
928void
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,
936 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
937 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
938 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
939 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
940 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
941 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
942 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
943 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08)
944{
945 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
946 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
947 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
948 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
949 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
950 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
951 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
952 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
953 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08));
954}
955#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 8
956
957#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 9
958template <class TYPE,
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,
965 class Args_02,
966 class Args_03,
967 class Args_04,
968 class Args_05,
969 class Args_06,
970 class Args_07,
971 class Args_08,
972 class Args_09>
973inline
974void
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,
982 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
983 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
984 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
985 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
986 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
987 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
988 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
989 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
990 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09)
991{
992 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
993 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
994 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
995 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
996 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
997 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
998 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
999 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1000 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1001 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09));
1002}
1003#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 9
1004
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,
1013 class Args_02,
1014 class Args_03,
1015 class Args_04,
1016 class Args_05,
1017 class Args_06,
1018 class Args_07,
1019 class Args_08,
1020 class Args_09,
1021 class Args_10>
1022inline
1023void
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,
1031 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1032 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1033 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1034 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1035 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1036 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1037 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1038 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1039 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1040 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10)
1041{
1042 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1043 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1044 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1045 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1046 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1047 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1048 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1049 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1050 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1051 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1052 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10));
1053}
1054#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 10
1055
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,
1064 class Args_02,
1065 class Args_03,
1066 class Args_04,
1067 class Args_05,
1068 class Args_06,
1069 class Args_07,
1070 class Args_08,
1071 class Args_09,
1072 class Args_10,
1073 class Args_11>
1074inline
1075void
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,
1083 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1084 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1085 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1086 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1087 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1088 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1089 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1090 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1091 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1092 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
1093 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11)
1094{
1095 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1096 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1097 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1098 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1099 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1100 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1101 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1102 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1103 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1104 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1105 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10),
1106 BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11));
1107}
1108#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 11
1109
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,
1118 class Args_02,
1119 class Args_03,
1120 class Args_04,
1121 class Args_05,
1122 class Args_06,
1123 class Args_07,
1124 class Args_08,
1125 class Args_09,
1126 class Args_10,
1127 class Args_11,
1128 class Args_12>
1129inline
1130void
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,
1138 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1139 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1140 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1141 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1142 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1143 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1144 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1145 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1146 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1147 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
1148 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
1149 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12)
1150{
1151 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1152 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1153 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1154 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1155 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1156 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1157 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1158 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1159 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1160 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1161 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10),
1162 BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11),
1163 BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12));
1164}
1165#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 12
1166
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,
1175 class Args_02,
1176 class Args_03,
1177 class Args_04,
1178 class Args_05,
1179 class Args_06,
1180 class Args_07,
1181 class Args_08,
1182 class Args_09,
1183 class Args_10,
1184 class Args_11,
1185 class Args_12,
1186 class Args_13>
1187inline
1188void
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,
1196 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1197 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1198 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1199 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1200 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1201 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1202 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1203 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1204 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1205 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
1206 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
1207 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12,
1208 BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13)
1209{
1210 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1211 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1212 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1213 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1214 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1215 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1216 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1217 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1218 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1219 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1220 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10),
1221 BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11),
1222 BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12),
1223 BSLS_COMPILERFEATURES_FORWARD(Args_13,arguments_13));
1224}
1225#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 13
1226
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,
1235 class Args_02,
1236 class Args_03,
1237 class Args_04,
1238 class Args_05,
1239 class Args_06,
1240 class Args_07,
1241 class Args_08,
1242 class Args_09,
1243 class Args_10,
1244 class Args_11,
1245 class Args_12,
1246 class Args_13,
1247 class Args_14>
1248inline
1249void
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,
1257 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1258 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1259 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1260 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1261 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1262 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1263 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1264 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1265 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1266 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
1267 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
1268 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12,
1269 BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13,
1270 BSLS_COMPILERFEATURES_FORWARD_REF(Args_14) arguments_14)
1271{
1272 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1273 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1274 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1275 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1276 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1277 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1278 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1279 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1280 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1281 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1282 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10),
1283 BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11),
1284 BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12),
1285 BSLS_COMPILERFEATURES_FORWARD(Args_13,arguments_13),
1286 BSLS_COMPILERFEATURES_FORWARD(Args_14,arguments_14));
1287}
1288#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 14
1289
1290#else
1291// The generated code below is a workaround for the absence of perfect
1292// forwarding in some compilers.
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>
1300inline
1301void
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,
1309 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... arguments)
1310{
1311 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1312 BSLS_COMPILERFEATURES_FORWARD(Args,arguments)...);
1313}
1314// }}} END GENERATED CODE
1315#endif
1316
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>
1323inline
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,
1329 IS_ALWAYS_EQUAL>::
1330deallocate(TYPE *address, bslma::Allocator::size_type)
1331{
1332 d_allocator_p->deallocate(address);
1333}
1334
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>
1342inline
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)
1350{
1351 address->~ELEMENT_TYPE();
1352}
1353
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>
1360inline
1361typename StdStatefulAllocator<
1362 TYPE,
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,
1373 IS_ALWAYS_EQUAL>::
1374max_size() const
1375{
1376 // Return the largest value, 'v', such that 'v * sizeof(T)' fits in a
1377 // 'size_type' (copied from bslstl_allocator).
1378
1379 // We will calculate MAX_NUM_BYTES based on our knowledge that
1380 // 'bslma::Allocator::size_type' is just an alias for 'std::size_t'. First
1381 // demonstrate that is true:
1382
1383 BSLMF_ASSERT((bsl::is_same<BloombergLP::bslma::Allocator::size_type,
1384 std::size_t>::value));
1385
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;
1390}
1391
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>
1398inline
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,
1404 IS_ALWAYS_EQUAL>
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,
1410 IS_ALWAYS_EQUAL>::
1411select_on_container_copy_construction() const
1412{
1413 if (PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION) {
1414 return *this; // RETURN
1415 }
1416
1417 // else
1418
1419 return StdStatefulAllocator(bslma::Default::defaultAllocator());
1420}
1421
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>
1428inline
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,
1435 IS_ALWAYS_EQUAL>::
1436allocator() const
1437{
1438 return d_allocator_p;
1439}
1440
1441} // close package namespace
1442
1443// FREE OPERATORS
1444template <class TYPE1,
1445 class TYPE2,
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>
1451inline
1452bool bsltf::operator==(const StdStatefulAllocator<
1453 TYPE1,
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<
1460 TYPE2,
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)
1466{
1467 return IS_ALWAYS_EQUAL || (lhs.allocator() == rhs.allocator());
1468}
1469
1470template <class TYPE1,
1471 class TYPE2,
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>
1477inline
1478bool bsltf::operator!=(const StdStatefulAllocator<
1479 TYPE1,
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<
1486 TYPE2,
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)
1492{
1493 return !IS_ALWAYS_EQUAL && (lhs.allocator() != rhs.allocator());
1494}
1495
1496
1497
1498#else // if ! defined(DEFINED_BSLTF_STDSTATEFULALLOCATOR_H)
1499# error Not valid except when included from bsltf_stdstatefulallocator.h
1500#endif // ! defined(COMPILING_BSLTF_STDSTATEFULALLOCATOR_H)
1501
1502#endif // ! defined(INCLUDED_BSLTF_STDSTATEFULALLOCATOR_CPP03)
1503
1504// ----------------------------------------------------------------------------
1505// Copyright 2013 Bloomberg Finance L.P.
1506//
1507// Licensed under the Apache License, Version 2.0 (the "License");
1508// you may not use this file except in compliance with the License.
1509// You may obtain a copy of the License at
1510//
1511// http://www.apache.org/licenses/LICENSE-2.0
1512//
1513// Unless required by applicable law or agreed to in writing, software
1514// distributed under the License is distributed on an "AS IS" BASIS,
1515// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1516// See the License for the specific language governing permissions and
1517// limitations under the License.
1518// ----------------------------- END-OF-FILE ----------------------------------
1519
1520/** @} */
1521/** @} */
1522/** @} */
#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
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