BDE 4.39.x 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 that constitutes its state.
79///
80/// \note Note that while we define the various
81/// traits used by the C++11 allocator traits facility, they actually mean
82/// very little for this component, as it is the consumer of the allocator's
83/// responsibility to check and apply the traits correctly, typically by
84/// using `bsl::allocator_traits` to perform all memory allocation tasks
85/// rather than using the allocator directly. The
86/// `PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION` flag is consumed directly
87/// though, in the static member function
88/// @ref select_on_container_copy_construction .
89///
90/// See @ref bsltf_stdstatefulallocator_cpp03
91template <class TYPE,
92 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION = true,
93 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT = true,
94 bool PROPAGATE_ON_CONTAINER_SWAP = true,
95 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT = true,
96 bool IS_ALWAYS_EQUAL = false>
97class StdStatefulAllocator {
98
99 private:
100 // DATA
101 bslma::Allocator *d_allocator_p; // the wrapped allocator (held, not
102 // owned)
103
104 public:
105 // TRAITS
106 BSLMF_NESTED_TRAIT_DECLARATION(StdStatefulAllocator,
108
109 // PUBLIC TYPES
110 typedef TYPE value_type;
111
112 // For a minimal allocator, these should all be deducible for a C++11
113 // container implementation. Unfortunately, the C++03 implementation of
114 // 'allocator_traits' supported by BDE does not try the leaps of template
115 // metaprogramming necessary to deduce these types. That is left for a
116 // future C++11 implementation, where language makes such metaprograms
117 // much simpler to write.
118
119#if !defined(BSLSTL_ALLOCATOR_TRAITS_SUPPORTS_ALL_CPP11_DEDUCTIONS)
120 typedef std::size_t size_type;
121 typedef std::ptrdiff_t difference_type;
122 typedef TYPE *pointer;
123 typedef const TYPE *const_pointer;
124#endif
125
126 typedef bsl::integral_constant<bool,
127 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT>
129
132
133 typedef bsl::integral_constant<bool,
134 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT>
136
137 typedef bsl::integral_constant<bool,
138 IS_ALWAYS_EQUAL>
140
141 /// This nested `struct` template, parameterized by some
142 /// `BDE_OTHER_TYPE`, provides a namespace for an `other` type alias,
143 /// which is an allocator type following the same template as this one but that allocates elements of `BDE_OTHER_TYPE`.
144 ///
145 /// \note Note that this
146 /// allocator type is convertible to and from `other` for any
147 /// `BDE_OTHER_TYPE` including `void`.
148 template <class BDE_OTHER_TYPE>
149 struct rebind
150 {
151
152 typedef StdStatefulAllocator<
153 BDE_OTHER_TYPE,
154 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
155 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
156 PROPAGATE_ON_CONTAINER_SWAP,
157 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
158 IS_ALWAYS_EQUAL> other;
159 };
160
161 // CREATORS
162
163 /// Create a `StdStatefulAllocator` object wrapping the specified
164 /// `allocator`.
166
167 StdStatefulAllocator(const StdStatefulAllocator& original) = default;
168 // Create an allocator having the same value as the specified
169 // 'original' object.
170
171 /// Create a `StdStatefulAllocator` object wrapping the same test
172 /// allocator as the specified `original`.
173 template <class BDE_OTHER_TYPE>
174 StdStatefulAllocator(const StdStatefulAllocator<
175 BDE_OTHER_TYPE,
176 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
177 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
178 PROPAGATE_ON_CONTAINER_SWAP,
179 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
180 IS_ALWAYS_EQUAL>& original);
181
182 ~StdStatefulAllocator() = default;
183 // Destroy this object.
184
185 // MANIPULATORS
187 operator=(const StdStatefulAllocator& rhs) = default;
188 // Assign to this object the value of the specified 'rhs' object, and
189 // return a reference providing modifiable access to this object.
190
191 /// Allocate enough (properly aligned) space for the specified
192 /// `numElements` of the (template parameter) type `TYPE`. If the
193 /// underlying `bslma::Allocator` is unable to fulfill the allocation
194 /// request, an exception (typically `bsl::bad_alloc`) will be thrown.
195 TYPE *allocate(bslma::Allocator::size_type numElements);
196
197#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
198// {{{ BEGIN GENERATED CODE
199// Command line: sim_cpp11_features.pl bsltf_stdstatefulallocator.h
200#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
201#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT 14
202#endif
203#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A
204#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
205#endif
206
207#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 0
208 template <class ELEMENT_TYPE>
209 void construct(ELEMENT_TYPE *address);
210#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 0
211
212#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 1
213 template <class ELEMENT_TYPE, class Args_01>
214 void construct(ELEMENT_TYPE *address,
215 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01);
216#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 1
217
218#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 2
219 template <class ELEMENT_TYPE, class Args_01,
220 class Args_02>
221 void construct(ELEMENT_TYPE *address,
222 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
223 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02);
224#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 2
225
226#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 3
227 template <class ELEMENT_TYPE, class Args_01,
228 class Args_02,
229 class Args_03>
230 void construct(ELEMENT_TYPE *address,
231 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
232 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
233 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03);
234#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 3
235
236#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 4
237 template <class ELEMENT_TYPE, class Args_01,
238 class Args_02,
239 class Args_03,
240 class Args_04>
241 void construct(ELEMENT_TYPE *address,
242 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
243 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
244 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
245 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04);
246#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 4
247
248#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 5
249 template <class ELEMENT_TYPE, class Args_01,
250 class Args_02,
251 class Args_03,
252 class Args_04,
253 class Args_05>
254 void construct(ELEMENT_TYPE *address,
255 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
256 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
257 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
258 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
259 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05);
260#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 5
261
262#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 6
263 template <class ELEMENT_TYPE, class Args_01,
264 class Args_02,
265 class Args_03,
266 class Args_04,
267 class Args_05,
268 class Args_06>
269 void construct(ELEMENT_TYPE *address,
270 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
271 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
272 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
273 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
274 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
275 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06);
276#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 6
277
278#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 7
279 template <class ELEMENT_TYPE, class Args_01,
280 class Args_02,
281 class Args_03,
282 class Args_04,
283 class Args_05,
284 class Args_06,
285 class Args_07>
286 void construct(ELEMENT_TYPE *address,
287 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
288 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
289 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
290 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
291 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
292 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
293 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07);
294#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 7
295
296#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 8
297 template <class ELEMENT_TYPE, class Args_01,
298 class Args_02,
299 class Args_03,
300 class Args_04,
301 class Args_05,
302 class Args_06,
303 class Args_07,
304 class Args_08>
305 void construct(ELEMENT_TYPE *address,
306 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
307 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
308 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
309 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
310 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
311 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
312 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
313 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08);
314#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 8
315
316#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 9
317 template <class ELEMENT_TYPE, class Args_01,
318 class Args_02,
319 class Args_03,
320 class Args_04,
321 class Args_05,
322 class Args_06,
323 class Args_07,
324 class Args_08,
325 class Args_09>
326 void construct(ELEMENT_TYPE *address,
327 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
328 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
329 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
330 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
331 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
332 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
333 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
334 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
335 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09);
336#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 9
337
338#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 10
339 template <class ELEMENT_TYPE, class Args_01,
340 class Args_02,
341 class Args_03,
342 class Args_04,
343 class Args_05,
344 class Args_06,
345 class Args_07,
346 class Args_08,
347 class Args_09,
348 class Args_10>
349 void construct(ELEMENT_TYPE *address,
350 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
351 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
352 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
353 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
354 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
355 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
356 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
357 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
358 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
359 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10);
360#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 10
361
362#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 11
363 template <class ELEMENT_TYPE, class Args_01,
364 class Args_02,
365 class Args_03,
366 class Args_04,
367 class Args_05,
368 class Args_06,
369 class Args_07,
370 class Args_08,
371 class Args_09,
372 class Args_10,
373 class Args_11>
374 void construct(ELEMENT_TYPE *address,
375 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
376 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
377 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
378 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
379 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
380 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
381 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
382 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
383 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
384 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
385 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11);
386#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 11
387
388#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 12
389 template <class ELEMENT_TYPE, class Args_01,
390 class Args_02,
391 class Args_03,
392 class Args_04,
393 class Args_05,
394 class Args_06,
395 class Args_07,
396 class Args_08,
397 class Args_09,
398 class Args_10,
399 class Args_11,
400 class Args_12>
401 void construct(ELEMENT_TYPE *address,
402 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
403 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
404 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
405 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
406 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
407 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
408 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
409 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
410 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
411 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
412 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
413 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12);
414#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 12
415
416#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 13
417 template <class ELEMENT_TYPE, class Args_01,
418 class Args_02,
419 class Args_03,
420 class Args_04,
421 class Args_05,
422 class Args_06,
423 class Args_07,
424 class Args_08,
425 class Args_09,
426 class Args_10,
427 class Args_11,
428 class Args_12,
429 class Args_13>
430 void construct(ELEMENT_TYPE *address,
431 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
432 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
433 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
434 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
435 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
436 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
437 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
438 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
439 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
440 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
441 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
442 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12,
443 BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13);
444#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 13
445
446#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 14
447 template <class ELEMENT_TYPE, class Args_01,
448 class Args_02,
449 class Args_03,
450 class Args_04,
451 class Args_05,
452 class Args_06,
453 class Args_07,
454 class Args_08,
455 class Args_09,
456 class Args_10,
457 class Args_11,
458 class Args_12,
459 class Args_13,
460 class Args_14>
461 void construct(ELEMENT_TYPE *address,
462 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
463 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
464 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
465 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
466 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
467 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
468 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
469 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
470 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
471 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
472 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
473 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12,
474 BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13,
475 BSLS_COMPILERFEATURES_FORWARD_REF(Args_14) arguments_14);
476#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_A >= 14
477
478#else
479// The generated code below is a workaround for the absence of perfect
480// forwarding in some compilers.
481
482 template <class ELEMENT_TYPE, class... Args>
483 void construct(ELEMENT_TYPE *address,
484 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... arguments);
485// }}} END GENERATED CODE
486#endif
487
488 /// Return memory previously allocated at the specified `address` for
489 /// `numElements` back to this allocator. The `numElements` argument is ignored by this allocator type.
490 ///
491 /// \pre The behavior is undefined unless
492 /// `address` was allocated using this allocator object and has not
493 /// already been deallocated.
494 void deallocate(TYPE *address, bslma::Allocator::size_type numElements);
495
496 /// Invoke the `ELEMENT_TYPE` destructor for the object at the specified
497 /// `address`.
498 template <class ELEMENT_TYPE>
499 void destroy(ELEMENT_TYPE *address);
500
501 // ACCESSORS
502#if !defined(BSLSTL_ALLOCATOR_TRAITS_SUPPORTS_ALL_CPP11_DEDUCTIONS)
503 /// Return the maximum number of elements of type `TYPE` that can be
504 /// allocated using this allocator in a single call to the `allocate` method.
505 ///
506 /// \note Note that there is no guarantee that attempts at allocating
507 /// less elements than the value returned by @ref max_size will not throw.
508 /// *** DO NOT RELY ON THE CONTINUING PRESENT OF THIS METHOD *** THIS
509 /// METHOD WILL BE REMOVED ONCE `bslstl::allocator_traits` PROPERLY
510 /// DEDUCES AN IMPLEMENTATION FOR THIS FUNCTION WHEN NOT SUPPLIED BY THE
511 /// ALLOCATOR DIRECTLY.
512 size_type max_size() const;
513#endif
514
515 /// Return a copy of this object if the `bool` template parameter
516 /// `PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION` is true, and a copy of a
517 /// `StdStatefulAllocator` object wrapping the default allocator
518 /// otherwise.
520
521 /// Return the address of the allocator wrapped by this object.
523};
524
525// FREE OPERATORS
526
527/// Return `true` if the specified `lhs` and `rhs` have the same underlying
528/// test allocator, and `false` otherwise.
529template <class TYPE1,
530 class TYPE2,
531 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
532 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
533 bool PROPAGATE_ON_CONTAINER_SWAP,
534 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
535 bool IS_ALWAYS_EQUAL>
536bool operator==(const StdStatefulAllocator<
537 TYPE1,
538 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
539 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
540 PROPAGATE_ON_CONTAINER_SWAP,
541 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
542 IS_ALWAYS_EQUAL>& lhs,
543 const StdStatefulAllocator<
544 TYPE2,
545 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
546 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
547 PROPAGATE_ON_CONTAINER_SWAP,
548 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
549 IS_ALWAYS_EQUAL>& rhs);
550
551/// Return `true` if the specified `lhs` and `rhs` have different underlying
552/// test allocators, and `false` otherwise.
553template <class TYPE1,
554 class TYPE2,
555 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
556 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
557 bool PROPAGATE_ON_CONTAINER_SWAP,
558 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
559 bool IS_ALWAYS_EQUAL>
560bool operator!=(const StdStatefulAllocator<
561 TYPE1,
562 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
563 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
564 PROPAGATE_ON_CONTAINER_SWAP,
565 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
566 IS_ALWAYS_EQUAL>& lhs,
567 const StdStatefulAllocator<
568 TYPE2,
569 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
570 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
571 PROPAGATE_ON_CONTAINER_SWAP,
572 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
573 IS_ALWAYS_EQUAL>& rhs);
574
575
576// ============================================================================
577// INLINE DEFINITIONS
578// ============================================================================
579
580 // --------------------------
581 // class StdStatefulAllocator
582 // --------------------------
583
584// CREATORS
585template <class TYPE,
586 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
587 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
588 bool PROPAGATE_ON_CONTAINER_SWAP,
589 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
590 bool IS_ALWAYS_EQUAL>
591inline
592StdStatefulAllocator<TYPE,
593 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
594 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
595 PROPAGATE_ON_CONTAINER_SWAP,
596 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
597 IS_ALWAYS_EQUAL>::
598StdStatefulAllocator(bslma::Allocator *allocator)
599: d_allocator_p(bslma::Default::allocator(allocator))
600{
601}
602
603template <class TYPE,
604 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
605 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
606 bool PROPAGATE_ON_CONTAINER_SWAP,
607 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
608 bool IS_ALWAYS_EQUAL>
609template <class BDE_OTHER_TYPE>
610inline
611StdStatefulAllocator<TYPE,
612 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
613 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
614 PROPAGATE_ON_CONTAINER_SWAP,
615 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
616 IS_ALWAYS_EQUAL>::
617StdStatefulAllocator(const StdStatefulAllocator<
618 BDE_OTHER_TYPE,
619 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
620 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
621 PROPAGATE_ON_CONTAINER_SWAP,
622 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
623 IS_ALWAYS_EQUAL>& original)
624: d_allocator_p(original.allocator())
625{
626}
627
628// MANIPULATORS
629template <class TYPE,
630 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
631 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
632 bool PROPAGATE_ON_CONTAINER_SWAP,
633 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
634 bool IS_ALWAYS_EQUAL>
635inline
636TYPE *
637StdStatefulAllocator<TYPE,
638 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
639 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
640 PROPAGATE_ON_CONTAINER_SWAP,
641 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
642 IS_ALWAYS_EQUAL>::allocate(
643 bslma::Allocator::size_type numElements)
644{
645 if (numElements > this->max_size()) {
646 BloombergLP::bsls::BslExceptionUtil::throwBadAlloc();
647 }
648
649 return static_cast<TYPE *>(d_allocator_p->allocate(
650 bslma::Allocator::size_type(numElements * sizeof(TYPE))));
651}
652
653#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
654// {{{ BEGIN GENERATED CODE
655// Command line: sim_cpp11_features.pl bsltf_stdstatefulallocator.h
656#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
657#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT 14
658#endif
659#ifndef BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B
660#define BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT
661#endif
662#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 0
663template <class TYPE,
664 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
665 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
666 bool PROPAGATE_ON_CONTAINER_SWAP,
667 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
668 bool IS_ALWAYS_EQUAL>
669template <class ELEMENT_TYPE>
670inline
671void
672StdStatefulAllocator<TYPE,
673 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
674 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
675 PROPAGATE_ON_CONTAINER_SWAP,
676 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
677 IS_ALWAYS_EQUAL>::construct(
678 ELEMENT_TYPE *address)
679{
680 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
681 );
682}
683#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 0
684
685#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 1
686template <class TYPE,
687 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
688 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
689 bool PROPAGATE_ON_CONTAINER_SWAP,
690 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
691 bool IS_ALWAYS_EQUAL>
692template <class ELEMENT_TYPE, class Args_01>
693inline
694void
695StdStatefulAllocator<TYPE,
696 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
697 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
698 PROPAGATE_ON_CONTAINER_SWAP,
699 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
700 IS_ALWAYS_EQUAL>::construct(
701 ELEMENT_TYPE *address,
702 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01)
703{
704 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
705 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01));
706}
707#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 1
708
709#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 2
710template <class TYPE,
711 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
712 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
713 bool PROPAGATE_ON_CONTAINER_SWAP,
714 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
715 bool IS_ALWAYS_EQUAL>
716template <class ELEMENT_TYPE, class Args_01,
717 class Args_02>
718inline
719void
720StdStatefulAllocator<TYPE,
721 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
722 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
723 PROPAGATE_ON_CONTAINER_SWAP,
724 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
725 IS_ALWAYS_EQUAL>::construct(
726 ELEMENT_TYPE *address,
727 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
728 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02)
729{
730 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
731 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
732 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02));
733}
734#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 2
735
736#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 3
737template <class TYPE,
738 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
739 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
740 bool PROPAGATE_ON_CONTAINER_SWAP,
741 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
742 bool IS_ALWAYS_EQUAL>
743template <class ELEMENT_TYPE, class Args_01,
744 class Args_02,
745 class Args_03>
746inline
747void
748StdStatefulAllocator<TYPE,
749 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
750 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
751 PROPAGATE_ON_CONTAINER_SWAP,
752 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
753 IS_ALWAYS_EQUAL>::construct(
754 ELEMENT_TYPE *address,
755 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
756 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
757 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03)
758{
759 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
760 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
761 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
762 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03));
763}
764#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 3
765
766#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 4
767template <class TYPE,
768 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
769 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
770 bool PROPAGATE_ON_CONTAINER_SWAP,
771 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
772 bool IS_ALWAYS_EQUAL>
773template <class ELEMENT_TYPE, class Args_01,
774 class Args_02,
775 class Args_03,
776 class Args_04>
777inline
778void
779StdStatefulAllocator<TYPE,
780 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
781 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
782 PROPAGATE_ON_CONTAINER_SWAP,
783 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
784 IS_ALWAYS_EQUAL>::construct(
785 ELEMENT_TYPE *address,
786 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
787 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
788 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
789 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04)
790{
791 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
792 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
793 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
794 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
795 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04));
796}
797#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 4
798
799#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 5
800template <class TYPE,
801 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
802 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
803 bool PROPAGATE_ON_CONTAINER_SWAP,
804 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
805 bool IS_ALWAYS_EQUAL>
806template <class ELEMENT_TYPE, class Args_01,
807 class Args_02,
808 class Args_03,
809 class Args_04,
810 class Args_05>
811inline
812void
813StdStatefulAllocator<TYPE,
814 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
815 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
816 PROPAGATE_ON_CONTAINER_SWAP,
817 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
818 IS_ALWAYS_EQUAL>::construct(
819 ELEMENT_TYPE *address,
820 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
821 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
822 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
823 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
824 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05)
825{
826 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
827 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
828 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
829 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
830 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
831 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05));
832}
833#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 5
834
835#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 6
836template <class TYPE,
837 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
838 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
839 bool PROPAGATE_ON_CONTAINER_SWAP,
840 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
841 bool IS_ALWAYS_EQUAL>
842template <class ELEMENT_TYPE, class Args_01,
843 class Args_02,
844 class Args_03,
845 class Args_04,
846 class Args_05,
847 class Args_06>
848inline
849void
850StdStatefulAllocator<TYPE,
851 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
852 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
853 PROPAGATE_ON_CONTAINER_SWAP,
854 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
855 IS_ALWAYS_EQUAL>::construct(
856 ELEMENT_TYPE *address,
857 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
858 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
859 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
860 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
861 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
862 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06)
863{
864 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
865 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
866 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
867 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
868 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
869 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
870 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06));
871}
872#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 6
873
874#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 7
875template <class TYPE,
876 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
877 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
878 bool PROPAGATE_ON_CONTAINER_SWAP,
879 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
880 bool IS_ALWAYS_EQUAL>
881template <class ELEMENT_TYPE, class Args_01,
882 class Args_02,
883 class Args_03,
884 class Args_04,
885 class Args_05,
886 class Args_06,
887 class Args_07>
888inline
889void
890StdStatefulAllocator<TYPE,
891 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
892 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
893 PROPAGATE_ON_CONTAINER_SWAP,
894 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
895 IS_ALWAYS_EQUAL>::construct(
896 ELEMENT_TYPE *address,
897 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
898 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
899 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
900 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
901 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
902 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
903 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07)
904{
905 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
906 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
907 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
908 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
909 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
910 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
911 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
912 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07));
913}
914#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 7
915
916#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 8
917template <class TYPE,
918 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
919 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
920 bool PROPAGATE_ON_CONTAINER_SWAP,
921 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
922 bool IS_ALWAYS_EQUAL>
923template <class ELEMENT_TYPE, class Args_01,
924 class Args_02,
925 class Args_03,
926 class Args_04,
927 class Args_05,
928 class Args_06,
929 class Args_07,
930 class Args_08>
931inline
932void
933StdStatefulAllocator<TYPE,
934 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
935 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
936 PROPAGATE_ON_CONTAINER_SWAP,
937 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
938 IS_ALWAYS_EQUAL>::construct(
939 ELEMENT_TYPE *address,
940 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
941 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
942 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
943 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
944 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
945 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
946 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
947 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08)
948{
949 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
950 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
951 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
952 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
953 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
954 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
955 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
956 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
957 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08));
958}
959#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 8
960
961#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 9
962template <class TYPE,
963 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
964 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
965 bool PROPAGATE_ON_CONTAINER_SWAP,
966 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
967 bool IS_ALWAYS_EQUAL>
968template <class ELEMENT_TYPE, class Args_01,
969 class Args_02,
970 class Args_03,
971 class Args_04,
972 class Args_05,
973 class Args_06,
974 class Args_07,
975 class Args_08,
976 class Args_09>
977inline
978void
979StdStatefulAllocator<TYPE,
980 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
981 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
982 PROPAGATE_ON_CONTAINER_SWAP,
983 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
984 IS_ALWAYS_EQUAL>::construct(
985 ELEMENT_TYPE *address,
986 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
987 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
988 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
989 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
990 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
991 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
992 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
993 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
994 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09)
995{
996 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
997 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
998 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
999 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1000 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1001 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1002 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1003 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1004 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1005 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09));
1006}
1007#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 9
1008
1009#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 10
1010template <class TYPE,
1011 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1012 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1013 bool PROPAGATE_ON_CONTAINER_SWAP,
1014 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1015 bool IS_ALWAYS_EQUAL>
1016template <class ELEMENT_TYPE, class Args_01,
1017 class Args_02,
1018 class Args_03,
1019 class Args_04,
1020 class Args_05,
1021 class Args_06,
1022 class Args_07,
1023 class Args_08,
1024 class Args_09,
1025 class Args_10>
1026inline
1027void
1028StdStatefulAllocator<TYPE,
1029 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1030 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1031 PROPAGATE_ON_CONTAINER_SWAP,
1032 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1033 IS_ALWAYS_EQUAL>::construct(
1034 ELEMENT_TYPE *address,
1035 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1036 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1037 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1038 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1039 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1040 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1041 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1042 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1043 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1044 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10)
1045{
1046 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1047 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1048 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1049 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1050 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1051 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1052 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1053 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1054 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1055 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1056 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10));
1057}
1058#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 10
1059
1060#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 11
1061template <class TYPE,
1062 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1063 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1064 bool PROPAGATE_ON_CONTAINER_SWAP,
1065 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1066 bool IS_ALWAYS_EQUAL>
1067template <class ELEMENT_TYPE, class Args_01,
1068 class Args_02,
1069 class Args_03,
1070 class Args_04,
1071 class Args_05,
1072 class Args_06,
1073 class Args_07,
1074 class Args_08,
1075 class Args_09,
1076 class Args_10,
1077 class Args_11>
1078inline
1079void
1080StdStatefulAllocator<TYPE,
1081 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1082 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1083 PROPAGATE_ON_CONTAINER_SWAP,
1084 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1085 IS_ALWAYS_EQUAL>::construct(
1086 ELEMENT_TYPE *address,
1087 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1088 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1089 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1090 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1091 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1092 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1093 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1094 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1095 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1096 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
1097 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11)
1098{
1099 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1100 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1101 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1102 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1103 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1104 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1105 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1106 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1107 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1108 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1109 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10),
1110 BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11));
1111}
1112#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 11
1113
1114#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 12
1115template <class TYPE,
1116 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1117 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1118 bool PROPAGATE_ON_CONTAINER_SWAP,
1119 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1120 bool IS_ALWAYS_EQUAL>
1121template <class ELEMENT_TYPE, class Args_01,
1122 class Args_02,
1123 class Args_03,
1124 class Args_04,
1125 class Args_05,
1126 class Args_06,
1127 class Args_07,
1128 class Args_08,
1129 class Args_09,
1130 class Args_10,
1131 class Args_11,
1132 class Args_12>
1133inline
1134void
1135StdStatefulAllocator<TYPE,
1136 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1137 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1138 PROPAGATE_ON_CONTAINER_SWAP,
1139 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1140 IS_ALWAYS_EQUAL>::construct(
1141 ELEMENT_TYPE *address,
1142 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1143 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1144 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1145 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1146 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1147 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1148 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1149 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1150 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1151 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
1152 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
1153 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12)
1154{
1155 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1156 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1157 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1158 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1159 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1160 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1161 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1162 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1163 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1164 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1165 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10),
1166 BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11),
1167 BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12));
1168}
1169#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 12
1170
1171#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 13
1172template <class TYPE,
1173 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1174 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1175 bool PROPAGATE_ON_CONTAINER_SWAP,
1176 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1177 bool IS_ALWAYS_EQUAL>
1178template <class ELEMENT_TYPE, class Args_01,
1179 class Args_02,
1180 class Args_03,
1181 class Args_04,
1182 class Args_05,
1183 class Args_06,
1184 class Args_07,
1185 class Args_08,
1186 class Args_09,
1187 class Args_10,
1188 class Args_11,
1189 class Args_12,
1190 class Args_13>
1191inline
1192void
1193StdStatefulAllocator<TYPE,
1194 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1195 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1196 PROPAGATE_ON_CONTAINER_SWAP,
1197 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1198 IS_ALWAYS_EQUAL>::construct(
1199 ELEMENT_TYPE *address,
1200 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1201 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1202 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1203 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1204 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1205 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1206 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1207 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1208 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1209 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
1210 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
1211 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12,
1212 BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13)
1213{
1214 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1215 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1216 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1217 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1218 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1219 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1220 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1221 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1222 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1223 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1224 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10),
1225 BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11),
1226 BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12),
1227 BSLS_COMPILERFEATURES_FORWARD(Args_13,arguments_13));
1228}
1229#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 13
1230
1231#if BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 14
1232template <class TYPE,
1233 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1234 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1235 bool PROPAGATE_ON_CONTAINER_SWAP,
1236 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1237 bool IS_ALWAYS_EQUAL>
1238template <class ELEMENT_TYPE, class Args_01,
1239 class Args_02,
1240 class Args_03,
1241 class Args_04,
1242 class Args_05,
1243 class Args_06,
1244 class Args_07,
1245 class Args_08,
1246 class Args_09,
1247 class Args_10,
1248 class Args_11,
1249 class Args_12,
1250 class Args_13,
1251 class Args_14>
1252inline
1253void
1254StdStatefulAllocator<TYPE,
1255 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1256 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1257 PROPAGATE_ON_CONTAINER_SWAP,
1258 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1259 IS_ALWAYS_EQUAL>::construct(
1260 ELEMENT_TYPE *address,
1261 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01,
1262 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02,
1263 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03,
1264 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04,
1265 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05,
1266 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06,
1267 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07,
1268 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08,
1269 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09,
1270 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10,
1271 BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11,
1272 BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12,
1273 BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13,
1274 BSLS_COMPILERFEATURES_FORWARD_REF(Args_14) arguments_14)
1275{
1276 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1277 BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01),
1278 BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02),
1279 BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03),
1280 BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04),
1281 BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05),
1282 BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06),
1283 BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07),
1284 BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08),
1285 BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09),
1286 BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10),
1287 BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11),
1288 BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12),
1289 BSLS_COMPILERFEATURES_FORWARD(Args_13,arguments_13),
1290 BSLS_COMPILERFEATURES_FORWARD(Args_14,arguments_14));
1291}
1292#endif // BSLTF_STDSTATEFULALLOCATOR_VARIADIC_LIMIT_B >= 14
1293
1294#else
1295// The generated code below is a workaround for the absence of perfect
1296// forwarding in some compilers.
1297template <class TYPE,
1298 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1299 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1300 bool PROPAGATE_ON_CONTAINER_SWAP,
1301 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1302 bool IS_ALWAYS_EQUAL>
1303template <class ELEMENT_TYPE, class... Args>
1304inline
1305void
1306StdStatefulAllocator<TYPE,
1307 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1308 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1309 PROPAGATE_ON_CONTAINER_SWAP,
1310 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1311 IS_ALWAYS_EQUAL>::construct(
1312 ELEMENT_TYPE *address,
1313 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... arguments)
1314{
1315 ::new (static_cast<void*>(address)) ELEMENT_TYPE(
1316 BSLS_COMPILERFEATURES_FORWARD(Args,arguments)...);
1317}
1318// }}} END GENERATED CODE
1319#endif
1320
1321template <class TYPE,
1322 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1323 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1324 bool PROPAGATE_ON_CONTAINER_SWAP,
1325 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1326 bool IS_ALWAYS_EQUAL>
1327inline
1328void StdStatefulAllocator<TYPE,
1329 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1330 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1331 PROPAGATE_ON_CONTAINER_SWAP,
1332 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1333 IS_ALWAYS_EQUAL>::
1334deallocate(TYPE *address, bslma::Allocator::size_type)
1335{
1336 d_allocator_p->deallocate(address);
1337}
1338
1339template <class TYPE,
1340 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1341 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1342 bool PROPAGATE_ON_CONTAINER_SWAP,
1343 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1344 bool IS_ALWAYS_EQUAL>
1345template <class ELEMENT_TYPE>
1346inline
1347void StdStatefulAllocator<TYPE,
1348 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1349 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1350 PROPAGATE_ON_CONTAINER_SWAP,
1351 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1352 IS_ALWAYS_EQUAL>::destroy(
1353 ELEMENT_TYPE * address)
1354{
1355 address->~ELEMENT_TYPE();
1356}
1357
1358template <class TYPE,
1359 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1360 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1361 bool PROPAGATE_ON_CONTAINER_SWAP,
1362 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1363 bool IS_ALWAYS_EQUAL>
1364inline
1365typename StdStatefulAllocator<
1366 TYPE,
1367 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1368 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1369 PROPAGATE_ON_CONTAINER_SWAP,
1370 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1371 IS_ALWAYS_EQUAL>::size_type
1372StdStatefulAllocator<TYPE,
1373 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1374 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1375 PROPAGATE_ON_CONTAINER_SWAP,
1376 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1377 IS_ALWAYS_EQUAL>::
1378max_size() const
1379{
1380 // Return the largest value, 'v', such that 'v * sizeof(T)' fits in a
1381 // 'size_type' (copied from bslstl_allocator).
1382
1383 // We will calculate MAX_NUM_BYTES based on our knowledge that
1384 // 'bslma::Allocator::size_type' is just an alias for 'std::size_t'. First
1385 // demonstrate that is true:
1386
1387 BSLMF_ASSERT((bsl::is_same<BloombergLP::bslma::Allocator::size_type,
1388 std::size_t>::value));
1389
1390 static const std::size_t MAX_NUM_BYTES = ~std::size_t(0);
1391 static const std::size_t MAX_NUM_ELEMENTS =
1392 std::size_t(MAX_NUM_BYTES) / sizeof(TYPE);
1393 return MAX_NUM_ELEMENTS;
1394}
1395
1396template <class TYPE,
1397 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1398 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1399 bool PROPAGATE_ON_CONTAINER_SWAP,
1400 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1401 bool IS_ALWAYS_EQUAL>
1402inline
1403StdStatefulAllocator<TYPE,
1404 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1405 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1406 PROPAGATE_ON_CONTAINER_SWAP,
1407 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1408 IS_ALWAYS_EQUAL>
1409StdStatefulAllocator<TYPE,
1410 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1411 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1412 PROPAGATE_ON_CONTAINER_SWAP,
1413 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1414 IS_ALWAYS_EQUAL>::
1415select_on_container_copy_construction() const
1416{
1417 if (PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION) {
1418 return *this; // RETURN
1419 }
1420
1421 // else
1422
1423 return StdStatefulAllocator(bslma::Default::defaultAllocator());
1424}
1425
1426template <class TYPE,
1427 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1428 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1429 bool PROPAGATE_ON_CONTAINER_SWAP,
1430 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1431 bool IS_ALWAYS_EQUAL>
1432inline
1434StdStatefulAllocator<TYPE,
1435 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1436 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1437 PROPAGATE_ON_CONTAINER_SWAP,
1438 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1439 IS_ALWAYS_EQUAL>::
1440allocator() const
1441{
1442 return d_allocator_p;
1443}
1444
1445} // close package namespace
1446
1447// FREE OPERATORS
1448template <class TYPE1,
1449 class TYPE2,
1450 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1451 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1452 bool PROPAGATE_ON_CONTAINER_SWAP,
1453 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1454 bool IS_ALWAYS_EQUAL>
1455inline
1456bool bsltf::operator==(const StdStatefulAllocator<
1457 TYPE1,
1458 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1459 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1460 PROPAGATE_ON_CONTAINER_SWAP,
1461 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1462 IS_ALWAYS_EQUAL>& lhs,
1463 const StdStatefulAllocator<
1464 TYPE2,
1465 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1466 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1467 PROPAGATE_ON_CONTAINER_SWAP,
1468 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1469 IS_ALWAYS_EQUAL>& rhs)
1470{
1471 return IS_ALWAYS_EQUAL || (lhs.allocator() == rhs.allocator());
1472}
1473
1474template <class TYPE1,
1475 class TYPE2,
1476 bool PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1477 bool PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1478 bool PROPAGATE_ON_CONTAINER_SWAP,
1479 bool PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1480 bool IS_ALWAYS_EQUAL>
1481inline
1482bool bsltf::operator!=(const StdStatefulAllocator<
1483 TYPE1,
1484 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1485 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1486 PROPAGATE_ON_CONTAINER_SWAP,
1487 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1488 IS_ALWAYS_EQUAL>& lhs,
1489 const StdStatefulAllocator<
1490 TYPE2,
1491 PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION,
1492 PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT,
1493 PROPAGATE_ON_CONTAINER_SWAP,
1494 PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT,
1495 IS_ALWAYS_EQUAL>& rhs)
1496{
1497 return !IS_ALWAYS_EQUAL && (lhs.allocator() != rhs.allocator());
1498}
1499
1500
1501
1502#else // if ! defined(DEFINED_BSLTF_STDSTATEFULALLOCATOR_H)
1503# error Not valid except when included from bsltf_stdstatefulallocator.h
1504#endif // ! defined(COMPILING_BSLTF_STDSTATEFULALLOCATOR_H)
1505
1506#endif // ! defined(INCLUDED_BSLTF_STDSTATEFULALLOCATOR_CPP03)
1507
1508// ----------------------------------------------------------------------------
1509// Copyright 2013 Bloomberg Finance L.P.
1510//
1511// Licensed under the Apache License, Version 2.0 (the "License");
1512// you may not use this file except in compliance with the License.
1513// You may obtain a copy of the License at
1514//
1515// http://www.apache.org/licenses/LICENSE-2.0
1516//
1517// Unless required by applicable law or agreed to in writing, software
1518// distributed under the License is distributed on an "AS IS" BASIS,
1519// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1520// See the License for the specific language governing permissions and
1521// limitations under the License.
1522// ----------------------------- END-OF-FILE ----------------------------------
1523
1524/** @} */
1525/** @} */
1526/** @} */
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
Definition bslma_allocator.h:545
virtual void deallocate(void *address)=0
std::size_t size_type
Definition bslma_allocator.h:593
virtual void * allocate(size_type size)=0
std::ptrdiff_t difference_type
Definition bsltf_stdstatefulallocator.h:262
bslma::Allocator * allocator() const
Return the address of the allocator wrapped by this object.
Definition bsltf_stdstatefulallocator.h:657
bsl::integral_constant< bool, PROPAGATE_ON_CONTAINER_MOVE_ASSIGNMENT > propagate_on_container_move_assignment
Definition bsltf_stdstatefulallocator.h:276
StdStatefulAllocator select_on_container_copy_construction() const
Definition bsltf_stdstatefulallocator.h:632
TYPE * allocate(bslma::Allocator::size_type numElements)
Definition bsltf_stdstatefulallocator.h:504
bsl::integral_constant< bool, PROPAGATE_ON_CONTAINER_COPY_ASSIGNMENT > propagate_on_container_copy_assignment
Definition bsltf_stdstatefulallocator.h:269
const TYPE * const_pointer
Definition bsltf_stdstatefulallocator.h:264
std::size_t size_type
Definition bsltf_stdstatefulallocator.h:261
TYPE value_type
Definition bsltf_stdstatefulallocator.h:251
bsl::integral_constant< bool, PROPAGATE_ON_CONTAINER_SWAP > propagate_on_container_swap
Definition bsltf_stdstatefulallocator.h:272
void destroy(ELEMENT_TYPE *address)
Definition bsltf_stdstatefulallocator.h:569
void construct(ELEMENT_TYPE *address, Args &&... arguments)
Definition bsltf_stdstatefulallocator.h:530
StdStatefulAllocator & operator=(const StdStatefulAllocator &rhs)=default
bsl::integral_constant< bool, IS_ALWAYS_EQUAL > is_always_equal
Definition bsltf_stdstatefulallocator.h:280
void deallocate(TYPE *address, bslma::Allocator::size_type numElements)
Definition bsltf_stdstatefulallocator.h:551
StdStatefulAllocator(bslma::Allocator *allocator=0)
Definition bsltf_stdstatefulallocator.h:460
size_type max_size() const
Definition bsltf_stdstatefulallocator.h:595
TYPE * pointer
Definition bsltf_stdstatefulallocator.h:263
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2343
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2349
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
ALLOCATOR & lhs
Definition bslstl_string.h:3917
Definition baljsn_encoder_testtypes.h:76
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:5549
Definition bslmf_integralconstant.h:261
Definition bslmf_issame.h:146
static Allocator * defaultAllocator()
Definition bslma_default.h:905
Definition bslma_isstdallocator.h:202
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:299