BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslalg_scalarprimitives.h
Go to the documentation of this file.
1/// @file bslalg_scalarprimitives.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslalg_scalarprimitives.h -*-C++-*-
8#ifndef INCLUDED_BSLALG_SCALARPRIMITIVES
9#define INCLUDED_BSLALG_SCALARPRIMITIVES
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslalg_scalarprimitives bslalg_scalarprimitives
15/// @brief Provide primitive algorithms that operate on single elements.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslalg
19/// @{
20/// @addtogroup bslalg_scalarprimitives
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslalg_scalarprimitives-purpose"> Purpose</a>
25/// * <a href="#bslalg_scalarprimitives-classes"> Classes </a>
26/// * <a href="#bslalg_scalarprimitives-description"> Description </a>
27/// * <a href="#bslalg_scalarprimitives-usage"> Usage </a>
28///
29/// # Purpose {#bslalg_scalarprimitives-purpose}
30/// Provide primitive algorithms that operate on single elements.
31///
32/// # Classes {#bslalg_scalarprimitives-classes}
33///
34/// - bslalg::ScalarPrimitives: namespace for algorithms
35///
36/// @see bslalg_constructorproxy
37///
38/// # Description {#bslalg_scalarprimitives-description}
39/// This component provides primitive algorithms that operate on
40/// single elements with a uniform interface but select a different
41/// implementation according to the various type traits possessed by the
42/// underlying type. Such primitives are exceptionally useful for implementing
43/// generic components such as containers. There are six families of
44/// algorithms, each with a collection of overloads:
45/// @code
46/// Algorithm Forwards to (depending on traits)
47/// ---------------- ------------------------------------------------
48/// defaultConstruct Default constructor, with or without allocator
49///
50/// copyConstruct Copy constructor, with or without allocator,
51/// or bitwise copy if appropriate
52///
53/// moveConstruct Move constructor, with or without allocator,
54/// or bitwise copy if appropriate. In C++03 mode,
55/// behavior is the same as 'copyConstruct'.
56///
57/// destructiveMove Move construction followed by destruction of the
58/// original, with or without allocator,
59/// or bitwise copy if appropriate
60///
61/// construct In-place construction (using variadic template
62/// arguments, simulated by overloads), with
63/// or without allocator
64///
65/// swap Three way assignment, or bitwise swap
66/// @endcode
67/// The traits under consideration by this component are:
68/// @code
69/// Trait Description
70/// -------------------------------------------- -----------------------------
71/// bsl::is_trivially_default_constructible "TYPE has the trivial default
72/// constructor trait", or
73/// "TYPE has a trivial default
74/// constructor"
75///
76/// bslmf::IsBitwiseCopyable "TYPE has the bit-wise
77/// copyable trait", or
78/// "TYPE is bit-wise copyable"
79/// (implies that it has a
80/// trivial destructor too)
81///
82/// bslmf::IsBitwiseMoveable "TYPE has the bit-wise
83/// moveable trait", or
84/// "TYPE is bit-wise moveable"
85///
86/// bslma::UsesBslmaAllocator "the 'TYPE' constructor takes
87/// an allocator argument", or
88/// "'TYPE' supports 'bslma'
89/// allocators"
90///
91/// bslmf::UsesAllocatorArgT "the 'TYPE' constructor takes
92/// an allocator argument", and
93/// optionally passes allocators
94/// as the first two arguments to
95/// each constructor, where the
96/// tag type 'allocator_arg_t' is
97/// first, and the allocator type
98/// is second.
99/// @endcode
100///
101/// ## Usage {#bslalg_scalarprimitives-usage}
102///
103///
104/// This component is for use primarily by the `bslstl` package. Other clients
105/// should use the STL algorithms provided in `<algorithm>` and `<memory>`.
106/// @}
107/** @} */
108/** @} */
109
110/** @addtogroup bsl
111 * @{
112 */
113/** @addtogroup bslalg
114 * @{
115 */
116/** @addtogroup bslalg_scalarprimitives
117 * @{
118 */
119
120#include <bslscm_version.h>
121
123
124#include <bslma_allocator.h>
127
128#include <bslmf_allocatorargt.h>
132#include <bslmf_isfundamental.h>
133#include <bslmf_ispointer.h>
134#include <bslmf_issame.h>
137#include <bslmf_movableref.h>
139#include <bslmf_util.h>
140
141#include <bsls_assert.h>
143#include <bsls_keyword.h>
144#include <bsls_platform.h>
145#include <bsls_util.h>
146
147#include <stddef.h>
148#include <string.h>
149
150#include <new> // placement 'new'
151
152#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
153#include <bslmf_removecvq.h>
154#endif
155
156
157
158namespace bslalg {
159
160struct ScalarPrimitives_Imp;
161
162 // =======================
163 // struct ScalarPrimitives
164 // =======================
165
166/// This `struct` provides a namespace for a suite of utility functions that
167/// operate on elements of a parameterized type `TARGET_TYPE`. If any of
168/// the `...Construct` methods throws, then its target `address` is left
169/// uninitialized and there are no effects, unless otherwise mentioned in
170/// the documentation.
171///
172/// See @ref bslalg_scalarprimitives
174
175 private:
176 // PRIVATE TYPES
178
179 public:
180 // CLASS METHODS
181
182 /// Build a default-initialized object of the parameterized
183 /// `TARGET_TYPE` in the uninitialized memory at the specified
184 /// `address`, as if by using the `TARGET_TYPE` default constructor. If
185 /// the specified `allocator` is based on `bslma::Allocator` and
186 /// `TARGET_TYPE` takes an allocator constructor argument, then
187 /// `allocator` is passed to the default constructor. If the
188 /// constructor throws, the `address` is left in an uninitialized state.
189 ///
190 /// \note Note that this operation may bypass the constructor and simply fill
191 /// memory with 0 if `TARGET_TYPE` has the trivial default constructor
192 /// trait and does not use `bslma::Allocator`.
193 template <class TARGET_TYPE>
194 static void defaultConstruct(TARGET_TYPE *address,
195 bslma::Allocator *allocator);
196 template <class TARGET_TYPE>
197 static void defaultConstruct(TARGET_TYPE *address,
198 void *allocator);
199
200 /// Build an object of the parameterized `TARGET_TYPE` from the
201 /// specified `original` object of the same `TARGET_TYPE` in the
202 /// uninitialized memory at the specified `address`, as if by using the
203 /// copy constructor of `TARGET_TYPE`. If the specified `allocator` is
204 /// based on `bslma::Allocator` and `TARGET_TYPE` takes an allocator
205 /// constructor argument, then `allocator` is passed to the copy
206 /// constructor. If the constructor throws, the `address` is left in an uninitialized state.
207 ///
208 /// \note Note that bit-wise copy will be used if
209 /// `TARGET_TYPE` has the bit-wise copyable trait.
210 template <class TARGET_TYPE>
211 static void copyConstruct(TARGET_TYPE *address,
212 const TARGET_TYPE& original,
213 bslma::Allocator *allocator);
214 template <class TARGET_TYPE>
215 static void copyConstruct(TARGET_TYPE *address,
216 const TARGET_TYPE& original,
217 void *allocator);
218
219 /// Build an object of the parameterized `TARGET_TYPE` from the
220 /// specified `original` object of the same `TARGET_TYPE` in the
221 /// uninitialized memory at the specified `address`, as if by using the
222 /// move constructor of `TARGET_TYPE`. If the specified `allocator` is
223 /// based on `bslma::Allocator` and `TARGET_TYPE` takes an allocator
224 /// constructor argument, then `allocator` is passed to the move
225 /// constructor. If the constructor throws, the `address` is left in an uninitialized state.
226 ///
227 /// \note Note that bit-wise copy will be used if
228 /// `TARGET_TYPE` has the bit-wise copyable trait (not the bit-wise
229 /// moveable trait, which indicates a destructive bit-wise move). In
230 /// C++03 mode, `moveConstruct` has the same effect as `copyConstruct`.
231 template <class TARGET_TYPE>
232 static void moveConstruct(TARGET_TYPE *address,
233 TARGET_TYPE& original,
234 bslma::Allocator *allocator);
235 template <class TARGET_TYPE>
236 static void moveConstruct(TARGET_TYPE *address,
237 TARGET_TYPE& original,
238 void *allocator);
239
240 /// Move the state of the object of the parameterized `TARGET_TYPE` from
241 /// the object at the specified `original` address to the uninitialized
242 /// memory at the specified `address`, as if by move constructing and
243 /// then destroying the original. If the parameterized `ALLOCATOR` is
244 /// based on `bslma::Allocator` and `TARGET_TYPE` takes an allocator
245 /// constructor argument, then the moved object uses the specified
246 /// `allocator` to supply memory. If the move constructor throws, the
247 /// `address` is left in an uninitialized state and the `original` is left unchanged.
248 ///
249 /// \pre The behavior is undefined unless the `original` object also uses the `allocator`.
250 ///
251 /// \note Note that bit-wise copy will be
252 /// used and `allocator` will be ignored if TARGET_TYPE' has the bit-wise moveable trait.
253 ///
254 /// \note Note that, if `ALLOCATOR` is not based on
255 /// `bslma::Allocator`, then the `allocator` argument is ignored; the
256 /// allocator used by the resulting object at `address` might or might
257 /// not be the same as the allocator used by `original`, depending on
258 /// whether `TARGET_TYPE` has a move constructor (C++11).
259 template <class TARGET_TYPE, class ALLOCATOR>
260 static void destructiveMove(TARGET_TYPE *address,
261 TARGET_TYPE *original,
262 ALLOCATOR *allocator);
263
264 /// Build an object of the parameterized `TARGET_TYPE` in the
265 /// uninitialized memory at the specified `address`. Use the
266 /// `TARGET_TYPE` constructor `TARGET_TYPE(ARG1 const&, ...)` taking the
267 /// specified `a1` up to `a14` arguments of the respective parameterized
268 /// `ARG1` up to `ARG14` types. If the specified `allocator` is based
269 /// on `bslma::Allocator` and `TARGET_TYPE` takes an allocator
270 /// constructor argument, then `allocator` is passed to the
271 /// `TARGET_TYPE` constructor in the manner appropriate to the traits
272 /// `bslmf::UsesAllocatorArgT` and `blsma::UsesBslmaAllocator`.
273 template <class TARGET_TYPE>
274 static void construct(TARGET_TYPE *address,
275 bslma::Allocator *allocator);
276 template <class TARGET_TYPE>
277 static void construct(TARGET_TYPE *address,
278 void *allocator);
279 template <class TARGET_TYPE, class ARG1>
280 static void construct(TARGET_TYPE *address,
281 const ARG1& a1,
282 bslma::Allocator *allocator);
283 template <class TARGET_TYPE, class ARG1>
284 static void construct(TARGET_TYPE *address,
285 const ARG1& a1,
286 void *allocator);
287 template <class TARGET_TYPE, class ARG1, class ARG2>
288 static void construct(TARGET_TYPE *address,
289 const ARG1& a1,
290 const ARG2& a2,
291 bslma::Allocator *allocator);
292 template <class TARGET_TYPE, class ARG1, class ARG2>
293 static void construct(TARGET_TYPE *address,
294 const ARG1& a1,
295 const ARG2& a2,
296 void *allocator);
297 template <class TARGET_TYPE,
298 class ARG1, class ARG2, class ARG3>
299 static void construct(TARGET_TYPE *address,
300 const ARG1& a1,
301 const ARG2& a2,
302 const ARG3& a3,
303 bslma::Allocator *allocator);
304 template <class TARGET_TYPE,
305 class ARG1, class ARG2, class ARG3>
306 static void construct(TARGET_TYPE *address,
307 const ARG1& a1,
308 const ARG2& a2,
309 const ARG3& a3,
310 void *allocator);
311 template <class TARGET_TYPE,
312 class ARG1, class ARG2, class ARG3, class ARG4>
313 static void construct(TARGET_TYPE *address,
314 const ARG1& a1,
315 const ARG2& a2,
316 const ARG3& a3,
317 const ARG4& a4,
318 bslma::Allocator *allocator);
319 template <class TARGET_TYPE,
320 class ARG1, class ARG2, class ARG3, class ARG4>
321 static void construct(TARGET_TYPE *address,
322 const ARG1& a1,
323 const ARG2& a2,
324 const ARG3& a3,
325 const ARG4& a4,
326 void *allocator);
327 template <class TARGET_TYPE,
328 class ARG1, class ARG2, class ARG3, class ARG4,
329 class ARG5>
330 static void construct(TARGET_TYPE *address,
331 const ARG1& a1,
332 const ARG2& a2,
333 const ARG3& a3,
334 const ARG4& a4,
335 const ARG5& a5,
336 bslma::Allocator *allocator);
337 template <class TARGET_TYPE,
338 class ARG1, class ARG2, class ARG3, class ARG4,
339 class ARG5>
340 static void construct(TARGET_TYPE *address,
341 const ARG1& a1,
342 const ARG2& a2,
343 const ARG3& a3,
344 const ARG4& a4,
345 const ARG5& a5,
346 void *allocator);
347 template <class TARGET_TYPE,
348 class ARG1, class ARG2, class ARG3, class ARG4,
349 class ARG5, class ARG6>
350 static void construct(TARGET_TYPE *address,
351 const ARG1& a1,
352 const ARG2& a2,
353 const ARG3& a3,
354 const ARG4& a4,
355 const ARG5& a5,
356 const ARG6& a6,
357 bslma::Allocator *allocator);
358 template <class TARGET_TYPE,
359 class ARG1, class ARG2, class ARG3, class ARG4,
360 class ARG5, class ARG6>
361 static void construct(TARGET_TYPE *address,
362 const ARG1& a1,
363 const ARG2& a2,
364 const ARG3& a3,
365 const ARG4& a4,
366 const ARG5& a5,
367 const ARG6& a6,
368 void *allocator);
369 template <class TARGET_TYPE,
370 class ARG1, class ARG2, class ARG3, class ARG4,
371 class ARG5, class ARG6, class ARG7>
372 static void construct(TARGET_TYPE *address,
373 const ARG1& a1,
374 const ARG2& a2,
375 const ARG3& a3,
376 const ARG4& a4,
377 const ARG5& a5,
378 const ARG6& a6,
379 const ARG7& a7,
380 bslma::Allocator *allocator);
381 template <class TARGET_TYPE,
382 class ARG1, class ARG2, class ARG3, class ARG4,
383 class ARG5, class ARG6, class ARG7>
384 static void construct(TARGET_TYPE *address,
385 const ARG1& a1,
386 const ARG2& a2,
387 const ARG3& a3,
388 const ARG4& a4,
389 const ARG5& a5,
390 const ARG6& a6,
391 const ARG7& a7,
392 void *allocator);
393 template <class TARGET_TYPE,
394 class ARG1, class ARG2, class ARG3, class ARG4,
395 class ARG5, class ARG6, class ARG7, class ARG8>
396 static void construct(TARGET_TYPE *address,
397 const ARG1& a1,
398 const ARG2& a2,
399 const ARG3& a3,
400 const ARG4& a4,
401 const ARG5& a5,
402 const ARG6& a6,
403 const ARG7& a7,
404 const ARG8& a8,
405 bslma::Allocator *allocator);
406 template <class TARGET_TYPE,
407 class ARG1, class ARG2, class ARG3, class ARG4,
408 class ARG5, class ARG6, class ARG7, class ARG8>
409 static void construct(TARGET_TYPE *address,
410 const ARG1& a1,
411 const ARG2& a2,
412 const ARG3& a3,
413 const ARG4& a4,
414 const ARG5& a5,
415 const ARG6& a6,
416 const ARG7& a7,
417 const ARG8& a8,
418 void *allocator);
419 template <class TARGET_TYPE,
420 class ARG1, class ARG2, class ARG3, class ARG4,
421 class ARG5, class ARG6, class ARG7, class ARG8,
422 class ARG9>
423 static void construct(TARGET_TYPE *address,
424 const ARG1& a1,
425 const ARG2& a2,
426 const ARG3& a3,
427 const ARG4& a4,
428 const ARG5& a5,
429 const ARG6& a6,
430 const ARG7& a7,
431 const ARG8& a8,
432 const ARG9& a9,
433 bslma::Allocator *allocator);
434 template <class TARGET_TYPE,
435 class ARG1, class ARG2, class ARG3, class ARG4,
436 class ARG5, class ARG6, class ARG7, class ARG8,
437 class ARG9>
438 static void construct(TARGET_TYPE *address,
439 const ARG1& a1,
440 const ARG2& a2,
441 const ARG3& a3,
442 const ARG4& a4,
443 const ARG5& a5,
444 const ARG6& a6,
445 const ARG7& a7,
446 const ARG8& a8,
447 const ARG9& a9,
448 void *allocator);
449 template <class TARGET_TYPE,
450 class ARG1, class ARG2, class ARG3, class ARG4,
451 class ARG5, class ARG6, class ARG7, class ARG8,
452 class ARG9, class ARG10>
453 static void construct(TARGET_TYPE *address,
454 const ARG1& a1,
455 const ARG2& a2,
456 const ARG3& a3,
457 const ARG4& a4,
458 const ARG5& a5,
459 const ARG6& a6,
460 const ARG7& a7,
461 const ARG8& a8,
462 const ARG9& a9,
463 const ARG10& a10,
464 bslma::Allocator *allocator);
465 template <class TARGET_TYPE,
466 class ARG1, class ARG2, class ARG3, class ARG4,
467 class ARG5, class ARG6, class ARG7, class ARG8,
468 class ARG9, class ARG10>
469 static void construct(TARGET_TYPE *address,
470 const ARG1& a1,
471 const ARG2& a2,
472 const ARG3& a3,
473 const ARG4& a4,
474 const ARG5& a5,
475 const ARG6& a6,
476 const ARG7& a7,
477 const ARG8& a8,
478 const ARG9& a9,
479 const ARG10& a10,
480 void *allocator);
481 template <class TARGET_TYPE,
482 class ARG1, class ARG2, class ARG3, class ARG4,
483 class ARG5, class ARG6, class ARG7, class ARG8,
484 class ARG9, class ARG10, class ARG11>
485 static void construct(TARGET_TYPE *address,
486 const ARG1& a1,
487 const ARG2& a2,
488 const ARG3& a3,
489 const ARG4& a4,
490 const ARG5& a5,
491 const ARG6& a6,
492 const ARG7& a7,
493 const ARG8& a8,
494 const ARG9& a9,
495 const ARG10& a10,
496 const ARG11& a11,
497 bslma::Allocator *allocator);
498 template <class TARGET_TYPE,
499 class ARG1, class ARG2, class ARG3, class ARG4,
500 class ARG5, class ARG6, class ARG7, class ARG8,
501 class ARG9, class ARG10, class ARG11>
502 static void construct(TARGET_TYPE *address,
503 const ARG1& a1,
504 const ARG2& a2,
505 const ARG3& a3,
506 const ARG4& a4,
507 const ARG5& a5,
508 const ARG6& a6,
509 const ARG7& a7,
510 const ARG8& a8,
511 const ARG9& a9,
512 const ARG10& a10,
513 const ARG11& a11,
514 void *allocator);
515 template <class TARGET_TYPE,
516 class ARG1, class ARG2, class ARG3, class ARG4,
517 class ARG5, class ARG6, class ARG7, class ARG8,
518 class ARG9, class ARG10, class ARG11, class ARG12>
519 static void construct(TARGET_TYPE *address,
520 const ARG1& a1,
521 const ARG2& a2,
522 const ARG3& a3,
523 const ARG4& a4,
524 const ARG5& a5,
525 const ARG6& a6,
526 const ARG7& a7,
527 const ARG8& a8,
528 const ARG9& a9,
529 const ARG10& a10,
530 const ARG11& a11,
531 const ARG12& a12,
532 bslma::Allocator *allocator);
533 template <class TARGET_TYPE,
534 class ARG1, class ARG2, class ARG3, class ARG4,
535 class ARG5, class ARG6, class ARG7, class ARG8,
536 class ARG9, class ARG10, class ARG11, class ARG12>
537 static void construct(TARGET_TYPE *address,
538 const ARG1& a1,
539 const ARG2& a2,
540 const ARG3& a3,
541 const ARG4& a4,
542 const ARG5& a5,
543 const ARG6& a6,
544 const ARG7& a7,
545 const ARG8& a8,
546 const ARG9& a9,
547 const ARG10& a10,
548 const ARG11& a11,
549 const ARG12& a12,
550 void *allocator);
551 template <class TARGET_TYPE,
552 class ARG1, class ARG2, class ARG3, class ARG4,
553 class ARG5, class ARG6, class ARG7, class ARG8,
554 class ARG9, class ARG10, class ARG11, class ARG12,
555 class ARG13>
556 static void construct(TARGET_TYPE *address,
557 const ARG1& a1,
558 const ARG2& a2,
559 const ARG3& a3,
560 const ARG4& a4,
561 const ARG5& a5,
562 const ARG6& a6,
563 const ARG7& a7,
564 const ARG8& a8,
565 const ARG9& a9,
566 const ARG10& a10,
567 const ARG11& a11,
568 const ARG12& a12,
569 const ARG13& a13,
570 bslma::Allocator *allocator);
571 template <class TARGET_TYPE,
572 class ARG1, class ARG2, class ARG3, class ARG4,
573 class ARG5, class ARG6, class ARG7, class ARG8,
574 class ARG9, class ARG10, class ARG11, class ARG12,
575 class ARG13>
576 static void construct(TARGET_TYPE *address,
577 const ARG1& a1,
578 const ARG2& a2,
579 const ARG3& a3,
580 const ARG4& a4,
581 const ARG5& a5,
582 const ARG6& a6,
583 const ARG7& a7,
584 const ARG8& a8,
585 const ARG9& a9,
586 const ARG10& a10,
587 const ARG11& a11,
588 const ARG12& a12,
589 const ARG13& a13,
590 void *allocator);
591 template <class TARGET_TYPE,
592 class ARG1, class ARG2, class ARG3, class ARG4,
593 class ARG5, class ARG6, class ARG7, class ARG8,
594 class ARG9, class ARG10, class ARG11, class ARG12,
595 class ARG13, class ARG14>
596 static void construct(TARGET_TYPE *address,
597 const ARG1& a1,
598 const ARG2& a2,
599 const ARG3& a3,
600 const ARG4& a4,
601 const ARG5& a5,
602 const ARG6& a6,
603 const ARG7& a7,
604 const ARG8& a8,
605 const ARG9& a9,
606 const ARG10& a10,
607 const ARG11& a11,
608 const ARG12& a12,
609 const ARG13& a13,
610 const ARG14& a14,
611 bslma::Allocator *allocator);
612 template <class TARGET_TYPE,
613 class ARG1, class ARG2, class ARG3, class ARG4,
614 class ARG5, class ARG6, class ARG7, class ARG8,
615 class ARG9, class ARG10, class ARG11, class ARG12,
616 class ARG13, class ARG14>
617 static void construct(TARGET_TYPE *address,
618 const ARG1& a1,
619 const ARG2& a2,
620 const ARG3& a3,
621 const ARG4& a4,
622 const ARG5& a5,
623 const ARG6& a6,
624 const ARG7& a7,
625 const ARG8& a8,
626 const ARG9& a9,
627 const ARG10& a10,
628 const ARG11& a11,
629 const ARG12& a12,
630 const ARG13& a13,
631 const ARG14& a14,
632 void *allocator);
633
634#ifndef BDE_OMIT_INTERNAL_DEPRECATED
635 /// Destroy the specified `object` of the parameterized `TARGET_TYPE`, as
636 /// if by calling the `TARGET_TYPE` destructor, but do not deallocate the memory occupied by `object`.
637 ///
638 /// \note Note that the destructor may deallocate
639 /// other memory owned by `object`. Also note that this function is a
640 /// no-op if the `TARGET_TYPE` has the trivial destructor trait. Further
641 /// note that the specified `allocator` is not used.
642 ///
643 /// @deprecated Use @ref bslma::DestructionUtil::destroy without an
644 /// allocator argument instead.
645 template <class TARGET_TYPE>
646 static void destruct(TARGET_TYPE *object,
647 void *allocator);
648
649 /// Destroy the specified `object` of the parameterized `TARGET_TYPE`, as
650 /// if by calling the `TARGET_TYPE` destructor, but do not deallocate the memory occupied by `object`.
651 ///
652 /// \note Note that the destructor may deallocate
653 /// other memory owned by `object`. Also note that this function is a
654 /// no-op if the `TARGET_TYPE` has the trivial destructor trait.
655 ///
656 /// @deprecated Use @ref bslma::DestructionUtil::destroy instead.
657 template <class TARGET_TYPE>
658 static void destruct(TARGET_TYPE *object);
659#endif // BDE_OMIT_INTERNAL_DEPRECATED
660
661 /// Swap the contents of the specified `lhs` of the parameterized
662 /// `LHS_TYPE` with those of the specified `rhs` of the parameterized `RHS_TYPE`.
663 ///
664 /// \note Note that, if `LHS_TYPE` and `RHS_TYPE` are the same
665 /// type and that type has the bit-wise moveable trait but does not use
666 /// `bslma` allocators, the swap can be performed using a three-way
667 /// bit-wise move.
668 template <class LHS_TYPE, class RHS_TYPE>
669 static void swap(LHS_TYPE& lhs, RHS_TYPE& rhs);
670};
671
672 // ===========================
673 // struct ScalarPrimitives_Imp
674 // ===========================
675
676/// This `struct` provides a namespace for a suite of utility functions that
677/// operate on arrays of elements of a parameterized type `TARGET_TYPE`.
678/// These utility functions are only for the purpose of implementing those
679/// in the `ScalarPrimitives` utility, and should not be used outside this
680/// component.
681///
682/// See @ref bslalg_scalarprimitives
684
685 enum {
686 // These constants are used in the overloads below, when the last
687 // argument is of type 'bsl::integral_constant<int, N> *', indicating
688 // that 'TARGET_TYPE' has the traits for which the enumerator equal to
689 // 'N' is named.
690
691 e_USES_ALLOCATOR_ARG_T_TRAITS = 5, // Implies USES_BSLMA_ALLOCATOR
696 e_NIL_TRAITS = 0
697 };
698
699 // CLASS METHODS
700
701 /// Return the `const`-unqualified value of the specified `pointer`.
702 /// This function resolves into a `const_cast` and therefore has no
703 /// runtime cost, it exists only for template argument deduction.
704 template <class TARGET_TYPE>
705 static TARGET_TYPE *unconst(const TARGET_TYPE *pointer);
706
707 /// Build a `TARGET_TYPE` object in a default state in the uninitialized
708 /// memory at the specified `address`, using the specified `allocator`
709 /// to supply memory if `TARGET_TYPE` uses `bslma` allocators. Use the
710 /// default constructor of the parameterized `TARGET_TYPE`, or `memset`
711 /// to 0 if `TARGET_TYPE` has a trivial default constructor. The last
712 /// argument is for traits overloading resolution only and its value is
713 /// ignored.
714 template <class TARGET_TYPE>
715 static void defaultConstruct(
716 TARGET_TYPE *address,
717 bslma::Allocator *allocator,
719 template <class TARGET_TYPE>
720 static void defaultConstruct(
721 TARGET_TYPE *address,
722 bslma::Allocator *allocator,
724 template <class TARGET_TYPE>
725 static void defaultConstruct(
726 TARGET_TYPE *address,
727 bslma::Allocator *allocator,
729 template <class TARGET_TYPE>
730 static void defaultConstruct(TARGET_TYPE *address,
731 bslma::Allocator *allocator,
733
734 /// Build a `TARGET_TYPE` object in a default state in the uninitialized
735 /// memory at the specified `address`. Use the default constructor of
736 /// the parameterized `TARGET_TYPE`, or `memset` to 0 if `TARGET_TYPE`
737 /// has a trivial default constructor. The last argument is for traits
738 /// overloading resolution only and its value is ignored.
739 template <class TARGET_TYPE>
740 static void defaultConstruct(
741 TARGET_TYPE *address,
743 template <class TARGET_TYPE>
744 static void defaultConstruct(TARGET_TYPE *address,
746
747 /// Build in the uninitialized memory at the specified `address` an
748 /// object of the parameterized `TARGET_TYPE` that is a copy of the
749 /// specified `original` object of the same `TARGET_TYPE`, using the
750 /// specified `allocator` to supply memory. Use the copy constructor of
751 /// the `TARGET_TYPE`, or a bit-wise copy if `TARGET_TYPE` is a bit-wise
752 /// copyable type. The last argument is for traits overloading resolution only and its value is ignored.
753 ///
754 /// \note Note that a bit-wise copy
755 /// is appropriate only if `TARGET_TYPE` does not take allocators.
756 template <class TARGET_TYPE>
757 static void copyConstruct(
758 TARGET_TYPE *address,
759 const TARGET_TYPE& original,
760 bslma::Allocator *allocator,
762 template <class TARGET_TYPE>
763 static void copyConstruct(
764 TARGET_TYPE *address,
765 const TARGET_TYPE& original,
766 bslma::Allocator *allocator,
768 template <class TARGET_TYPE>
769 static void copyConstruct(
770 TARGET_TYPE *address,
771 const TARGET_TYPE& original,
772 bslma::Allocator *allocator,
774 template <class TARGET_TYPE>
775 static void copyConstruct(TARGET_TYPE *address,
776 const TARGET_TYPE& original,
777 bslma::Allocator *allocator,
779
780 /// Build in the uninitialized memory at the specified `address` an
781 /// object of the parameterized `TARGET_TYPE` that is a copy of the
782 /// specified `original` object of the same `TARGET_TYPE`. Use the copy
783 /// constructor of the `TARGET_TYPE`, or a bit-wise copy if
784 /// `TARGET_TYPE` is a bit-wise copyable type. The last argument is for
785 /// traits overloading resolution only and its value is ignored.
786 ///
787 /// \note Note that a bit-wise copy is appropriate only if `TARGET_TYPE` does not
788 /// take allocators.
789 template <class TARGET_TYPE>
790 static void copyConstruct(
791 TARGET_TYPE *address,
792 const TARGET_TYPE& original,
794 template <class TARGET_TYPE>
795 static void copyConstruct(TARGET_TYPE *address,
796 const TARGET_TYPE& original,
798
799 /// Build in the uninitialized memory at the specified `address` an
800 /// object of the parameterized `TARGET_TYPE` that is a move of the
801 /// specified `original` object of the same `TARGET_TYPE`, using the
802 /// specified `allocator` to supply memory. Use the move constructor
803 /// of the `TARGET_TYPE`, or a bit-wise copy if `TARGET_TYPE` is a
804 /// bit-wise copyable type (not a bit-wise moveable type, which
805 /// indicates a destructive bit-wise move). The last argument is for
806 /// traits overloading resolution only and its value is ignored.
807 ///
808 /// \note Note that a bit-wise copy is used only if `TARGET_TYPE` does not take
809 /// allocators. In C++03 mode, `moveConstruct` has the same effect as
810 /// `copyConstruct`.
811 template <class TARGET_TYPE>
812 static void moveConstruct(
813 TARGET_TYPE *address,
814 TARGET_TYPE& original,
815 bslma::Allocator *allocator,
817 template <class TARGET_TYPE>
818 static void moveConstruct(
819 TARGET_TYPE *address,
820 TARGET_TYPE& original,
821 bslma::Allocator *allocator,
823 template <class TARGET_TYPE>
824 static void moveConstruct(
825 TARGET_TYPE *address,
826 TARGET_TYPE& original,
827 bslma::Allocator *allocator,
829 template <class TARGET_TYPE>
830 static void moveConstruct(TARGET_TYPE *address,
831 TARGET_TYPE& original,
832 bslma::Allocator *allocator,
834
835 /// Build in the uninitialized memory at the specified `address` an
836 /// object of the parameterized `TARGET_TYPE` that is a move of the
837 /// specified `original` object of the same `TARGET_TYPE`. Use the move
838 /// constructor of the `TARGET_TYPE`, or a bit-wise copy if
839 /// `TARGET_TYPE` is a bit-wise copyable type (bit-wise copyable, NOT
840 /// bit-wise moveable, which relates to destructive bit-wise move). The
841 /// last argument is for traits overloading resolution only and its
842 /// value is ignored. In C++03 mode, `moveConstruct` has the same
843 /// effect as `copyConstruct`.
844 template <class TARGET_TYPE>
845 static void moveConstruct(
846 TARGET_TYPE *address,
847 TARGET_TYPE& original,
849 template <class TARGET_TYPE>
850 static void moveConstruct(TARGET_TYPE *address,
851 TARGET_TYPE& original,
853
854 /// Build a copy of the specified `original` in the uninitialized memory
855 /// at the specified `address`. Use the copy constructor of the
856 /// parameterized `TARGET_TYPE` (or a bit-wise copy if `TARGET_TYPE` is
857 /// bit-wise moveable). If `TARGET_TYPE` is not bit-wise moveable, also
858 /// destroy the `original`. The last argument is for traits overloading resolution only and its value is ignored.
859 ///
860 /// \note Note that the specified
861 /// `allocator` is not used.
862 template <class TARGET_TYPE, class ALLOCATOR>
863 static void destructiveMove(
864 TARGET_TYPE *address,
865 TARGET_TYPE *original,
866 ALLOCATOR *allocator,
868 template <class TARGET_TYPE, class ALLOCATOR>
869 static void destructiveMove(TARGET_TYPE *address,
870 TARGET_TYPE *original,
871 ALLOCATOR *allocator,
873
874 /// Build an object from the specified `a1` in the uninitialized memory
875 /// at the specified `address`. The specified `allocator` is ignored.
876 /// Use the parameterized `TARGET_TYPE` constructor with the signature
877 /// `TARGET_TYPE(ARG1 const&)` or bitwise copy for non-fundamental
878 /// types. The traits argument is for overloading resolution only and is ignored.
879 ///
880 /// \note Note that this function is called only when `ARG1` is
881 /// the same as `TARGET_TYPE`.
882 template <class TARGET_TYPE, class ARG1>
883 static void construct(
884 TARGET_TYPE *address,
885 const ARG1& a1,
886 bslma::Allocator *allocator,
888
889 /// Build an object of the parameterized `TARGET_TYPE` in the
890 /// uninitialized memory at the specified `address`, passing the
891 /// specified `a1` up to `a14` arguments of the corresponding
892 /// parameterized `ARG1` up to `ARG14` types to the `TARGET_TYPE`
893 /// constructor with the signature 'TARGET_TYPE(bsl::allocator_arg_t,
894 /// bslma::Allocator *, const ARG1&, ...)', and pass the specified
895 /// `allocator` as the second argument. The last argument is for
896 /// overloading resolution only and its value is ignored.
897 template <class TARGET_TYPE>
898 static void construct(
899 TARGET_TYPE *address,
900 bslma::Allocator *allocator,
902 template <class TARGET_TYPE, class ARG1>
903 static void construct(
904 TARGET_TYPE *address,
905 const ARG1& a1,
906 bslma::Allocator *allocator,
908 template <class TARGET_TYPE, class ARG1, class ARG2>
909 static void construct(
910 TARGET_TYPE *address,
911 const ARG1& a1,
912 const ARG2& a2,
913 bslma::Allocator *allocator,
915 template <class TARGET_TYPE,
916 class ARG1, class ARG2, class ARG3>
917 static void construct(
918 TARGET_TYPE *address,
919 const ARG1& a1,
920 const ARG2& a2,
921 const ARG3& a3,
922 bslma::Allocator *allocator,
924 template <class TARGET_TYPE,
925 class ARG1, class ARG2, class ARG3, class ARG4>
926 static void construct(
927 TARGET_TYPE *address,
928 const ARG1& a1,
929 const ARG2& a2,
930 const ARG3& a3,
931 const ARG4& a4,
932 bslma::Allocator *allocator,
934 template <class TARGET_TYPE,
935 class ARG1, class ARG2, class ARG3, class ARG4,
936 class ARG5>
937 static void construct(
938 TARGET_TYPE *address,
939 const ARG1& a1,
940 const ARG2& a2,
941 const ARG3& a3,
942 const ARG4& a4,
943 const ARG5& a5,
944 bslma::Allocator *allocator,
946 template <class TARGET_TYPE,
947 class ARG1, class ARG2, class ARG3, class ARG4,
948 class ARG5, class ARG6>
949 static void construct(
950 TARGET_TYPE *address,
951 const ARG1& a1,
952 const ARG2& a2,
953 const ARG3& a3,
954 const ARG4& a4,
955 const ARG5& a5,
956 const ARG6& a6,
957 bslma::Allocator *allocator,
959 template <class TARGET_TYPE,
960 class ARG1, class ARG2, class ARG3, class ARG4,
961 class ARG5, class ARG6, class ARG7>
962 static void construct(
963 TARGET_TYPE *address,
964 const ARG1& a1,
965 const ARG2& a2,
966 const ARG3& a3,
967 const ARG4& a4,
968 const ARG5& a5,
969 const ARG6& a6,
970 const ARG7& a7,
971 bslma::Allocator *allocator,
973 template <class TARGET_TYPE,
974 class ARG1, class ARG2, class ARG3, class ARG4,
975 class ARG5, class ARG6, class ARG7, class ARG8>
976 static void construct(
977 TARGET_TYPE *address,
978 const ARG1& a1,
979 const ARG2& a2,
980 const ARG3& a3,
981 const ARG4& a4,
982 const ARG5& a5,
983 const ARG6& a6,
984 const ARG7& a7,
985 const ARG8& a8,
986 bslma::Allocator *allocator,
988 template <class TARGET_TYPE,
989 class ARG1, class ARG2, class ARG3, class ARG4,
990 class ARG5, class ARG6, class ARG7, class ARG8,
991 class ARG9>
992 static void construct(
993 TARGET_TYPE *address,
994 const ARG1& a1,
995 const ARG2& a2,
996 const ARG3& a3,
997 const ARG4& a4,
998 const ARG5& a5,
999 const ARG6& a6,
1000 const ARG7& a7,
1001 const ARG8& a8,
1002 const ARG9& a9,
1003 bslma::Allocator *allocator,
1005 template <class TARGET_TYPE,
1006 class ARG1, class ARG2, class ARG3, class ARG4,
1007 class ARG5, class ARG6, class ARG7, class ARG8,
1008 class ARG9, class ARG10>
1009 static void construct(
1010 TARGET_TYPE *address,
1011 const ARG1& a1,
1012 const ARG2& a2,
1013 const ARG3& a3,
1014 const ARG4& a4,
1015 const ARG5& a5,
1016 const ARG6& a6,
1017 const ARG7& a7,
1018 const ARG8& a8,
1019 const ARG9& a9,
1020 const ARG10& a10,
1021 bslma::Allocator *allocator,
1023 template <class TARGET_TYPE,
1024 class ARG1, class ARG2, class ARG3, class ARG4,
1025 class ARG5, class ARG6, class ARG7, class ARG8,
1026 class ARG9, class ARG10, class ARG11>
1027 static void construct(
1028 TARGET_TYPE *address,
1029 const ARG1& a1,
1030 const ARG2& a2,
1031 const ARG3& a3,
1032 const ARG4& a4,
1033 const ARG5& a5,
1034 const ARG6& a6,
1035 const ARG7& a7,
1036 const ARG8& a8,
1037 const ARG9& a9,
1038 const ARG10& a10,
1039 const ARG11& a11,
1040 bslma::Allocator *allocator,
1042 template <class TARGET_TYPE,
1043 class ARG1, class ARG2, class ARG3, class ARG4,
1044 class ARG5, class ARG6, class ARG7, class ARG8,
1045 class ARG9, class ARG10, class ARG11, class ARG12>
1046 static void construct(
1047 TARGET_TYPE *address,
1048 const ARG1& a1,
1049 const ARG2& a2,
1050 const ARG3& a3,
1051 const ARG4& a4,
1052 const ARG5& a5,
1053 const ARG6& a6,
1054 const ARG7& a7,
1055 const ARG8& a8,
1056 const ARG9& a9,
1057 const ARG10& a10,
1058 const ARG11& a11,
1059 const ARG12& a12,
1060 bslma::Allocator *allocator,
1062 template <class TARGET_TYPE,
1063 class ARG1, class ARG2, class ARG3, class ARG4,
1064 class ARG5, class ARG6, class ARG7, class ARG8,
1065 class ARG9, class ARG10, class ARG11, class ARG12,
1066 class ARG13>
1067 static void construct(
1068 TARGET_TYPE *address,
1069 const ARG1& a1,
1070 const ARG2& a2,
1071 const ARG3& a3,
1072 const ARG4& a4,
1073 const ARG5& a5,
1074 const ARG6& a6,
1075 const ARG7& a7,
1076 const ARG8& a8,
1077 const ARG9& a9,
1078 const ARG10& a10,
1079 const ARG11& a11,
1080 const ARG12& a12,
1081 const ARG13& a13,
1082 bslma::Allocator *allocator,
1084 template <class TARGET_TYPE,
1085 class ARG1, class ARG2, class ARG3, class ARG4,
1086 class ARG5, class ARG6, class ARG7, class ARG8,
1087 class ARG9, class ARG10, class ARG11, class ARG12,
1088 class ARG13, class ARG14>
1089 static void construct(
1090 TARGET_TYPE *address,
1091 const ARG1& a1,
1092 const ARG2& a2,
1093 const ARG3& a3,
1094 const ARG4& a4,
1095 const ARG5& a5,
1096 const ARG6& a6,
1097 const ARG7& a7,
1098 const ARG8& a8,
1099 const ARG9& a9,
1100 const ARG10& a10,
1101 const ARG11& a11,
1102 const ARG12& a12,
1103 const ARG13& a13,
1104 const ARG14& a14,
1105 bslma::Allocator *allocator,
1107
1108 /// Build an object of the parameterized `TARGET_TYPE` in the
1109 /// uninitialized memory at the specified `address`, passing the
1110 /// specified `a1` up to `a14` arguments of the corresponding
1111 /// parameterized `ARG1` up to `ARG14` types to the `TARGET_TYPE`
1112 /// constructor with the signature
1113 /// `TARGET_TYPE(ARG1 const&, ..., bslma::Allocator *)`, and pass the
1114 /// specified `allocator` in the last position. The last argument is
1115 /// for overloading resolution only and its value is ignored.
1116 template <class TARGET_TYPE>
1117 static void construct(
1118 TARGET_TYPE *address,
1119 bslma::Allocator *allocator,
1121 template <class TARGET_TYPE, class ARG1>
1122 static void construct(
1123 TARGET_TYPE *address,
1124 const ARG1& a1,
1125 bslma::Allocator *allocator,
1127 template <class TARGET_TYPE, class ARG1, class ARG2>
1128 static void construct(
1129 TARGET_TYPE *address,
1130 const ARG1& a1,
1131 const ARG2& a2,
1132 bslma::Allocator *allocator,
1134 template <class TARGET_TYPE,
1135 class ARG1, class ARG2, class ARG3>
1136 static void construct(
1137 TARGET_TYPE *address,
1138 const ARG1& a1,
1139 const ARG2& a2,
1140 const ARG3& a3,
1141 bslma::Allocator *allocator,
1143 template <class TARGET_TYPE,
1144 class ARG1, class ARG2, class ARG3, class ARG4>
1145 static void construct(
1146 TARGET_TYPE *address,
1147 const ARG1& a1,
1148 const ARG2& a2,
1149 const ARG3& a3,
1150 const ARG4& a4,
1151 bslma::Allocator *allocator,
1153 template <class TARGET_TYPE,
1154 class ARG1, class ARG2, class ARG3, class ARG4,
1155 class ARG5>
1156 static void construct(
1157 TARGET_TYPE *address,
1158 const ARG1& a1,
1159 const ARG2& a2,
1160 const ARG3& a3,
1161 const ARG4& a4,
1162 const ARG5& a5,
1163 bslma::Allocator *allocator,
1165 template <class TARGET_TYPE,
1166 class ARG1, class ARG2, class ARG3, class ARG4,
1167 class ARG5, class ARG6>
1168 static void construct(
1169 TARGET_TYPE *address,
1170 const ARG1& a1,
1171 const ARG2& a2,
1172 const ARG3& a3,
1173 const ARG4& a4,
1174 const ARG5& a5,
1175 const ARG6& a6,
1176 bslma::Allocator *allocator,
1178 template <class TARGET_TYPE,
1179 class ARG1, class ARG2, class ARG3, class ARG4,
1180 class ARG5, class ARG6, class ARG7>
1181 static void construct(
1182 TARGET_TYPE *address,
1183 const ARG1& a1,
1184 const ARG2& a2,
1185 const ARG3& a3,
1186 const ARG4& a4,
1187 const ARG5& a5,
1188 const ARG6& a6,
1189 const ARG7& a7,
1190 bslma::Allocator *allocator,
1192 template <class TARGET_TYPE,
1193 class ARG1, class ARG2, class ARG3, class ARG4,
1194 class ARG5, class ARG6, class ARG7, class ARG8>
1195 static void construct(
1196 TARGET_TYPE *address,
1197 const ARG1& a1,
1198 const ARG2& a2,
1199 const ARG3& a3,
1200 const ARG4& a4,
1201 const ARG5& a5,
1202 const ARG6& a6,
1203 const ARG7& a7,
1204 const ARG8& a8,
1205 bslma::Allocator *allocator,
1207 template <class TARGET_TYPE,
1208 class ARG1, class ARG2, class ARG3, class ARG4,
1209 class ARG5, class ARG6, class ARG7, class ARG8,
1210 class ARG9>
1211 static void construct(
1212 TARGET_TYPE *address,
1213 const ARG1& a1,
1214 const ARG2& a2,
1215 const ARG3& a3,
1216 const ARG4& a4,
1217 const ARG5& a5,
1218 const ARG6& a6,
1219 const ARG7& a7,
1220 const ARG8& a8,
1221 const ARG9& a9,
1222 bslma::Allocator *allocator,
1224 template <class TARGET_TYPE,
1225 class ARG1, class ARG2, class ARG3, class ARG4,
1226 class ARG5, class ARG6, class ARG7, class ARG8,
1227 class ARG9, class ARG10>
1228 static void construct(
1229 TARGET_TYPE *address,
1230 const ARG1& a1,
1231 const ARG2& a2,
1232 const ARG3& a3,
1233 const ARG4& a4,
1234 const ARG5& a5,
1235 const ARG6& a6,
1236 const ARG7& a7,
1237 const ARG8& a8,
1238 const ARG9& a9,
1239 const ARG10& a10,
1240 bslma::Allocator *allocator,
1242 template <class TARGET_TYPE,
1243 class ARG1, class ARG2, class ARG3, class ARG4,
1244 class ARG5, class ARG6, class ARG7, class ARG8,
1245 class ARG9, class ARG10, class ARG11>
1246 static void construct(
1247 TARGET_TYPE *address,
1248 const ARG1& a1,
1249 const ARG2& a2,
1250 const ARG3& a3,
1251 const ARG4& a4,
1252 const ARG5& a5,
1253 const ARG6& a6,
1254 const ARG7& a7,
1255 const ARG8& a8,
1256 const ARG9& a9,
1257 const ARG10& a10,
1258 const ARG11& a11,
1259 bslma::Allocator *allocator,
1261 template <class TARGET_TYPE,
1262 class ARG1, class ARG2, class ARG3, class ARG4,
1263 class ARG5, class ARG6, class ARG7, class ARG8,
1264 class ARG9, class ARG10, class ARG11, class ARG12>
1265 static void construct(
1266 TARGET_TYPE *address,
1267 const ARG1& a1,
1268 const ARG2& a2,
1269 const ARG3& a3,
1270 const ARG4& a4,
1271 const ARG5& a5,
1272 const ARG6& a6,
1273 const ARG7& a7,
1274 const ARG8& a8,
1275 const ARG9& a9,
1276 const ARG10& a10,
1277 const ARG11& a11,
1278 const ARG12& a12,
1279 bslma::Allocator *allocator,
1281 template <class TARGET_TYPE,
1282 class ARG1, class ARG2, class ARG3, class ARG4,
1283 class ARG5, class ARG6, class ARG7, class ARG8,
1284 class ARG9, class ARG10, class ARG11, class ARG12,
1285 class ARG13>
1286 static void construct(
1287 TARGET_TYPE *address,
1288 const ARG1& a1,
1289 const ARG2& a2,
1290 const ARG3& a3,
1291 const ARG4& a4,
1292 const ARG5& a5,
1293 const ARG6& a6,
1294 const ARG7& a7,
1295 const ARG8& a8,
1296 const ARG9& a9,
1297 const ARG10& a10,
1298 const ARG11& a11,
1299 const ARG12& a12,
1300 const ARG13& a13,
1301 bslma::Allocator *allocator,
1303 template <class TARGET_TYPE,
1304 class ARG1, class ARG2, class ARG3, class ARG4,
1305 class ARG5, class ARG6, class ARG7, class ARG8,
1306 class ARG9, class ARG10, class ARG11, class ARG12,
1307 class ARG13, class ARG14>
1308 static void construct(
1309 TARGET_TYPE *address,
1310 const ARG1& a1,
1311 const ARG2& a2,
1312 const ARG3& a3,
1313 const ARG4& a4,
1314 const ARG5& a5,
1315 const ARG6& a6,
1316 const ARG7& a7,
1317 const ARG8& a8,
1318 const ARG9& a9,
1319 const ARG10& a10,
1320 const ARG11& a11,
1321 const ARG12& a12,
1322 const ARG13& a13,
1323 const ARG14& a14,
1324 bslma::Allocator *allocator,
1326
1327 /// Build an object of the parameterized `TARGET_TYPE` in the
1328 /// uninitialized memory at the specified `address`, passing the
1329 /// specified `a1` up to `a14` arguments of the corresponding
1330 /// parameterized `ARG1` up to `ARG14` types to the `TARGET_TYPE`
1331 /// constructor with the signature `TARGET_TYPE(ARG1 const&, ...)`. The
1332 /// specified `allocator` is *not* passed through to the `TARGET_TYPE`
1333 /// constructor. The last argument is for overloading resolution only
1334 /// and is ignored.
1335 template <class TARGET_TYPE>
1336 static void construct(TARGET_TYPE *address,
1337 bslma::Allocator *allocator,
1339 template <class TARGET_TYPE, class ARG1>
1340 static void construct(TARGET_TYPE *address,
1341 const ARG1& a1,
1342 bslma::Allocator *allocator,
1344 template <class TARGET_TYPE, class ARG1, class ARG2>
1345 static void construct(TARGET_TYPE *address,
1346 const ARG1& a1,
1347 const ARG2& a2,
1348 bslma::Allocator *allocator,
1350 template <class TARGET_TYPE,
1351 class ARG1, class ARG2, class ARG3>
1352 static void construct(TARGET_TYPE *address,
1353 const ARG1& a1,
1354 const ARG2& a2,
1355 const ARG3& a3,
1356 bslma::Allocator *allocator,
1358 template <class TARGET_TYPE,
1359 class ARG1, class ARG2, class ARG3, class ARG4>
1360 static void construct(TARGET_TYPE *address,
1361 const ARG1& a1,
1362 const ARG2& a2,
1363 const ARG3& a3,
1364 const ARG4& a4,
1365 bslma::Allocator *allocator,
1367 template <class TARGET_TYPE,
1368 class ARG1, class ARG2, class ARG3, class ARG4,
1369 class ARG5>
1370 static void construct(TARGET_TYPE *address,
1371 const ARG1& a1,
1372 const ARG2& a2,
1373 const ARG3& a3,
1374 const ARG4& a4,
1375 const ARG5& a5,
1376 bslma::Allocator *allocator,
1378 template <class TARGET_TYPE,
1379 class ARG1, class ARG2, class ARG3, class ARG4,
1380 class ARG5, class ARG6>
1381 static void construct(TARGET_TYPE *address,
1382 const ARG1& a1,
1383 const ARG2& a2,
1384 const ARG3& a3,
1385 const ARG4& a4,
1386 const ARG5& a5,
1387 const ARG6& a6,
1388 bslma::Allocator *allocator,
1390 template <class TARGET_TYPE,
1391 class ARG1, class ARG2, class ARG3, class ARG4,
1392 class ARG5, class ARG6, class ARG7>
1393 static void construct(TARGET_TYPE *address,
1394 const ARG1& a1,
1395 const ARG2& a2,
1396 const ARG3& a3,
1397 const ARG4& a4,
1398 const ARG5& a5,
1399 const ARG6& a6,
1400 const ARG7& a7,
1401 bslma::Allocator *allocator,
1403 template <class TARGET_TYPE,
1404 class ARG1, class ARG2, class ARG3, class ARG4,
1405 class ARG5, class ARG6, class ARG7, class ARG8>
1406 static void construct(TARGET_TYPE *address,
1407 const ARG1& a1,
1408 const ARG2& a2,
1409 const ARG3& a3,
1410 const ARG4& a4,
1411 const ARG5& a5,
1412 const ARG6& a6,
1413 const ARG7& a7,
1414 const ARG8& a8,
1415 bslma::Allocator *allocator,
1417 template <class TARGET_TYPE,
1418 class ARG1, class ARG2, class ARG3, class ARG4,
1419 class ARG5, class ARG6, class ARG7, class ARG8,
1420 class ARG9>
1421 static void construct(TARGET_TYPE *address,
1422 const ARG1& a1,
1423 const ARG2& a2,
1424 const ARG3& a3,
1425 const ARG4& a4,
1426 const ARG5& a5,
1427 const ARG6& a6,
1428 const ARG7& a7,
1429 const ARG8& a8,
1430 const ARG9& a9,
1431 bslma::Allocator *allocator,
1433 template <class TARGET_TYPE,
1434 class ARG1, class ARG2, class ARG3, class ARG4,
1435 class ARG5, class ARG6, class ARG7, class ARG8,
1436 class ARG9, class ARG10>
1437 static void construct(TARGET_TYPE *address,
1438 const ARG1& a1,
1439 const ARG2& a2,
1440 const ARG3& a3,
1441 const ARG4& a4,
1442 const ARG5& a5,
1443 const ARG6& a6,
1444 const ARG7& a7,
1445 const ARG8& a8,
1446 const ARG9& a9,
1447 const ARG10& a10,
1448 bslma::Allocator *allocator,
1450 template <class TARGET_TYPE,
1451 class ARG1, class ARG2, class ARG3, class ARG4,
1452 class ARG5, class ARG6, class ARG7, class ARG8,
1453 class ARG9, class ARG10, class ARG11>
1454 static void construct(TARGET_TYPE *address,
1455 const ARG1& a1,
1456 const ARG2& a2,
1457 const ARG3& a3,
1458 const ARG4& a4,
1459 const ARG5& a5,
1460 const ARG6& a6,
1461 const ARG7& a7,
1462 const ARG8& a8,
1463 const ARG9& a9,
1464 const ARG10& a10,
1465 const ARG11& a11,
1466 bslma::Allocator *allocator,
1468 template <class TARGET_TYPE,
1469 class ARG1, class ARG2, class ARG3, class ARG4,
1470 class ARG5, class ARG6, class ARG7, class ARG8,
1471 class ARG9, class ARG10, class ARG11, class ARG12>
1472 static void construct(TARGET_TYPE *address,
1473 const ARG1& a1,
1474 const ARG2& a2,
1475 const ARG3& a3,
1476 const ARG4& a4,
1477 const ARG5& a5,
1478 const ARG6& a6,
1479 const ARG7& a7,
1480 const ARG8& a8,
1481 const ARG9& a9,
1482 const ARG10& a10,
1483 const ARG11& a11,
1484 const ARG12& a12,
1485 bslma::Allocator *allocator,
1487 template <class TARGET_TYPE,
1488 class ARG1, class ARG2, class ARG3, class ARG4,
1489 class ARG5, class ARG6, class ARG7, class ARG8,
1490 class ARG9, class ARG10, class ARG11, class ARG12,
1491 class ARG13>
1492 static void construct(TARGET_TYPE *address,
1493 const ARG1& a1,
1494 const ARG2& a2,
1495 const ARG3& a3,
1496 const ARG4& a4,
1497 const ARG5& a5,
1498 const ARG6& a6,
1499 const ARG7& a7,
1500 const ARG8& a8,
1501 const ARG9& a9,
1502 const ARG10& a10,
1503 const ARG11& a11,
1504 const ARG12& a12,
1505 const ARG13& a13,
1506 bslma::Allocator *allocator,
1508 template <class TARGET_TYPE,
1509 class ARG1, class ARG2, class ARG3, class ARG4,
1510 class ARG5, class ARG6, class ARG7, class ARG8,
1511 class ARG9, class ARG10, class ARG11, class ARG12,
1512 class ARG13, class ARG14>
1513 static void construct(TARGET_TYPE *address,
1514 const ARG1& a1,
1515 const ARG2& a2,
1516 const ARG3& a3,
1517 const ARG4& a4,
1518 const ARG5& a5,
1519 const ARG6& a6,
1520 const ARG7& a7,
1521 const ARG8& a8,
1522 const ARG9& a9,
1523 const ARG10& a10,
1524 const ARG11& a11,
1525 const ARG12& a12,
1526 const ARG13& a13,
1527 const ARG14& a14,
1528 bslma::Allocator *allocator,
1530
1531 /// Swap the contents of the specified `lhs` object of the parameterized
1532 /// `LHS_TYPE` with the specified `rhs` object of the parameterized
1533 /// `RHS_TYPE`. Use a three-way bit-wise copy (with a temporary
1534 /// uninitialized buffer), if `LHS_TYPE` and `RHS_TYPE` are the same
1535 /// bit-wise moveable type, and a three-way assignment with a temporary
1536 /// if not. The last argument is for overloading resolution only and is
1537 /// ignored.
1538 template <class LHS_TYPE, class RHS_TYPE>
1539 static void swap(LHS_TYPE& lhs,
1540 RHS_TYPE& rhs,
1542 template <class LHS_TYPE, class RHS_TYPE>
1543 static void swap(LHS_TYPE& lhs,
1544 RHS_TYPE& rhs,
1546};
1547
1548// ============================================================================
1549// TEMPLATE FUNCTION DEFINITIONS
1550// ============================================================================
1551
1552
1553// Workaround for optimization issue in xlC that mishandles pointer aliasing.
1554// IV56864: ALIASING BEHAVIOUR FOR PLACEMENT NEW
1555// http://www-01.ibm.com/support/docview.wss?uid=swg1IV56864
1556// Place this macro following each use of placement new. Alternatively,
1557// compile with xlC_r -qalias=noansi, which reduces optimization opportunities
1558// across entire translation unit instead of simply across optimization fence.
1559// Update: issue is fixed in xlC 13.1 (__xlC__ >= 0x0d01).
1560
1561#if defined(BSLS_PLATFORM_CMP_IBM) && BSLS_PLATFORM_CMP_VERSION < 0x0d01
1562 #define BSLALG_SCALARPRIMITIVES_XLC_PLACEMENT_NEW_FIX \
1563 BSLS_PERFORMANCEHINT_OPTIMIZATION_FENCE
1564#else
1565 #define BSLALG_SCALARPRIMITIVES_XLC_PLACEMENT_NEW_FIX
1566#endif
1567
1568 // -----------------------
1569 // struct ScalarPrimitives
1570 // -----------------------
1571
1572 // *** defaultConstruct overloads: ***
1573
1574template <class TARGET_TYPE>
1575inline
1576void
1595
1596template <class TARGET_TYPE>
1597inline
1598void
1611
1612 // *** copyConstruct overloads: ***
1613
1614template <class TARGET_TYPE>
1615inline
1616void
1635
1636template <class TARGET_TYPE>
1637inline
1638void
1640 const TARGET_TYPE& original,
1641 void *)
1642{
1643 BSLS_ASSERT_SAFE(address);
1644
1645 enum {
1649 };
1650 Imp::copyConstruct(address,
1651 original,
1653}
1654
1655 // *** moveConstruct overloads: ***
1656
1657template <class TARGET_TYPE>
1658inline
1659void
1678
1679template <class TARGET_TYPE>
1680inline
1681void
1683 TARGET_TYPE& original,
1684 void *)
1685{
1686 BSLS_ASSERT_SAFE(address);
1687
1688 enum {
1692 };
1693 Imp::moveConstruct(address, original,
1695}
1696
1697
1698 // *** destructiveMove overloads: ***
1699
1700template <class TARGET_TYPE, class ALLOCATOR>
1701inline
1702void
1704 TARGET_TYPE *original,
1705 ALLOCATOR *allocator)
1706{
1707 BSLS_ASSERT_SAFE(address);
1708 BSLS_ASSERT_SAFE(original);
1709
1710 enum {
1714 };
1715 Imp::destructiveMove(address,
1716 original,
1717 allocator,
1719}
1720
1721 // *** construct overloads: ****
1722
1723template <class TARGET_TYPE>
1724inline
1725void
1741
1742template <class TARGET_TYPE>
1743inline
1744void
1745ScalarPrimitives::construct(TARGET_TYPE *address,
1746 void *)
1747{
1748 BSLS_ASSERT_SAFE(address);
1749
1750 ::new (address) TARGET_TYPE();
1752}
1753
1754template <class TARGET_TYPE, class ARG1>
1755inline
1756void
1776
1777template <class TARGET_TYPE, class ARG1>
1778inline
1779void
1780ScalarPrimitives::construct(TARGET_TYPE *address,
1781 const ARG1& a1,
1782 void *)
1783{
1784 BSLS_ASSERT_SAFE(address);
1785
1786 ::new (address) TARGET_TYPE(a1);
1788}
1789
1790template <class TARGET_TYPE, class ARG1, class ARG2>
1791inline
1792void
1793ScalarPrimitives::construct(TARGET_TYPE *address,
1794 const ARG1& a1,
1795 const ARG2& a2,
1796 bslma::Allocator *allocator)
1797{
1798 BSLS_ASSERT_SAFE(address);
1799
1800 enum {
1806 };
1807 Imp::construct(address, a1, a2, allocator,
1809}
1810
1811template <class TARGET_TYPE, class ARG1, class ARG2>
1812inline
1813void
1814ScalarPrimitives::construct(TARGET_TYPE *address,
1815 const ARG1& a1,
1816 const ARG2& a2,
1817 void *)
1818{
1819 BSLS_ASSERT_SAFE(address);
1820
1821 ::new (address) TARGET_TYPE(a1, a2);
1823}
1824
1825template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
1826inline
1827void
1828ScalarPrimitives::construct(TARGET_TYPE *address,
1829 const ARG1& a1,
1830 const ARG2& a2,
1831 const ARG3& a3,
1832 bslma::Allocator *allocator)
1833{
1834 BSLS_ASSERT_SAFE(address);
1835
1836 enum {
1842 };
1843 Imp::construct(address,
1844 a1, a2, a3,
1845 allocator,
1847}
1848
1849template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
1850inline
1851void
1852ScalarPrimitives::construct(TARGET_TYPE *address,
1853 const ARG1& a1,
1854 const ARG2& a2,
1855 const ARG3& a3,
1856 void *)
1857{
1858 BSLS_ASSERT_SAFE(address);
1859
1860 ::new (address) TARGET_TYPE(a1, a2, a3);
1862}
1863
1864template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1865 class ARG4>
1866inline
1867void
1868ScalarPrimitives::construct(TARGET_TYPE *address,
1869 const ARG1& a1,
1870 const ARG2& a2,
1871 const ARG3& a3,
1872 const ARG4& a4,
1873 bslma::Allocator *allocator)
1874{
1875 BSLS_ASSERT_SAFE(address);
1876
1877 enum {
1883 };
1884 Imp::construct(address,
1885 a1, a2, a3, a4,
1886 allocator,
1888}
1889
1890template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1891 class ARG4>
1892inline
1893void
1894ScalarPrimitives::construct(TARGET_TYPE *address,
1895 const ARG1& a1,
1896 const ARG2& a2,
1897 const ARG3& a3,
1898 const ARG4& a4,
1899 void *)
1900{
1901 BSLS_ASSERT_SAFE(address);
1902
1903 ::new (address) TARGET_TYPE(a1, a2, a3, a4);
1905}
1906
1907template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1908 class ARG4, class ARG5>
1909inline
1910void
1911ScalarPrimitives::construct(TARGET_TYPE *address,
1912 const ARG1& a1,
1913 const ARG2& a2,
1914 const ARG3& a3,
1915 const ARG4& a4,
1916 const ARG5& a5,
1917 bslma::Allocator *allocator)
1918{
1919 BSLS_ASSERT_SAFE(address);
1920
1921 enum {
1927 };
1928 Imp::construct(address,
1929 a1, a2, a3, a4, a5,
1930 allocator,
1932}
1933
1934template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1935 class ARG4, class ARG5>
1936inline
1937void
1938ScalarPrimitives::construct(TARGET_TYPE *address,
1939 const ARG1& a1,
1940 const ARG2& a2,
1941 const ARG3& a3,
1942 const ARG4& a4,
1943 const ARG5& a5,
1944 void *)
1945{
1946 BSLS_ASSERT_SAFE(address);
1947
1948 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5);
1950}
1951
1952template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1953 class ARG4, class ARG5, class ARG6>
1954inline
1955void
1956ScalarPrimitives::construct(TARGET_TYPE *address,
1957 const ARG1& a1,
1958 const ARG2& a2,
1959 const ARG3& a3,
1960 const ARG4& a4,
1961 const ARG5& a5,
1962 const ARG6& a6,
1963 bslma::Allocator *allocator)
1964{
1965 BSLS_ASSERT_SAFE(address);
1966
1967 enum {
1973 };
1974 Imp::construct(address,
1975 a1, a2, a3, a4, a5, a6,
1976 allocator,
1978}
1979
1980template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1981 class ARG4, class ARG5, class ARG6>
1982inline
1983void
1984ScalarPrimitives::construct(TARGET_TYPE *address,
1985 const ARG1& a1,
1986 const ARG2& a2,
1987 const ARG3& a3,
1988 const ARG4& a4,
1989 const ARG5& a5,
1990 const ARG6& a6,
1991 void *)
1992{
1993 BSLS_ASSERT_SAFE(address);
1994
1995 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6);
1997}
1998
1999template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2000 class ARG4, class ARG5, class ARG6, class ARG7>
2001inline
2002void
2003ScalarPrimitives::construct(TARGET_TYPE *address,
2004 const ARG1& a1,
2005 const ARG2& a2,
2006 const ARG3& a3,
2007 const ARG4& a4,
2008 const ARG5& a5,
2009 const ARG6& a6,
2010 const ARG7& a7,
2011 bslma::Allocator *allocator)
2012{
2013 BSLS_ASSERT_SAFE(address);
2014
2015 enum {
2021 };
2022 Imp::construct(address,
2023 a1, a2, a3, a4, a5, a6, a7,
2024 allocator,
2026}
2027
2028template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2029 class ARG4, class ARG5, class ARG6, class ARG7>
2030inline
2031void
2032ScalarPrimitives::construct(TARGET_TYPE *address,
2033 const ARG1& a1,
2034 const ARG2& a2,
2035 const ARG3& a3,
2036 const ARG4& a4,
2037 const ARG5& a5,
2038 const ARG6& a6,
2039 const ARG7& a7,
2040 void *)
2041{
2042 BSLS_ASSERT_SAFE(address);
2043
2044 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7);
2046}
2047
2048template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2049 class ARG4, class ARG5, class ARG6, class ARG7,
2050 class ARG8>
2051inline
2052void
2053ScalarPrimitives::construct(TARGET_TYPE *address,
2054 const ARG1& a1,
2055 const ARG2& a2,
2056 const ARG3& a3,
2057 const ARG4& a4,
2058 const ARG5& a5,
2059 const ARG6& a6,
2060 const ARG7& a7,
2061 const ARG8& a8,
2062 bslma::Allocator *allocator)
2063{
2064 BSLS_ASSERT_SAFE(address);
2065
2066 enum {
2072 };
2073 Imp::construct(address,
2074 a1, a2, a3, a4, a5, a6, a7, a8,
2075 allocator,
2077}
2078
2079template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2080 class ARG4, class ARG5, class ARG6, class ARG7,
2081 class ARG8>
2082inline
2083void
2084ScalarPrimitives::construct(TARGET_TYPE *address,
2085 const ARG1& a1,
2086 const ARG2& a2,
2087 const ARG3& a3,
2088 const ARG4& a4,
2089 const ARG5& a5,
2090 const ARG6& a6,
2091 const ARG7& a7,
2092 const ARG8& a8,
2093 void *)
2094{
2095 BSLS_ASSERT_SAFE(address);
2096
2097 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8);
2099}
2100
2101template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2102 class ARG4, class ARG5, class ARG6, class ARG7,
2103 class ARG8, class ARG9>
2104inline
2105void
2106ScalarPrimitives::construct(TARGET_TYPE *address,
2107 const ARG1& a1,
2108 const ARG2& a2,
2109 const ARG3& a3,
2110 const ARG4& a4,
2111 const ARG5& a5,
2112 const ARG6& a6,
2113 const ARG7& a7,
2114 const ARG8& a8,
2115 const ARG9& a9,
2116 bslma::Allocator *allocator)
2117{
2118 BSLS_ASSERT_SAFE(address);
2119
2120 enum {
2126 };
2127 Imp::construct(address,
2128 a1, a2, a3, a4, a5, a6, a7, a8, a9,
2129 allocator,
2131}
2132
2133template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2134 class ARG4, class ARG5, class ARG6, class ARG7,
2135 class ARG8, class ARG9>
2136inline
2137void
2138ScalarPrimitives::construct(TARGET_TYPE *address,
2139 const ARG1& a1,
2140 const ARG2& a2,
2141 const ARG3& a3,
2142 const ARG4& a4,
2143 const ARG5& a5,
2144 const ARG6& a6,
2145 const ARG7& a7,
2146 const ARG8& a8,
2147 const ARG9& a9,
2148 void *)
2149{
2150 BSLS_ASSERT_SAFE(address);
2151
2152 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9);
2154}
2155
2156template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2157 class ARG4, class ARG5, class ARG6, class ARG7,
2158 class ARG8, class ARG9, class ARG10>
2159inline
2160void
2161ScalarPrimitives::construct(TARGET_TYPE *address,
2162 const ARG1& a1,
2163 const ARG2& a2,
2164 const ARG3& a3,
2165 const ARG4& a4,
2166 const ARG5& a5,
2167 const ARG6& a6,
2168 const ARG7& a7,
2169 const ARG8& a8,
2170 const ARG9& a9,
2171 const ARG10& a10,
2172 bslma::Allocator *allocator)
2173{
2174 BSLS_ASSERT_SAFE(address);
2175
2176 enum {
2182 };
2183 Imp::construct(address,
2184 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
2185 allocator,
2187}
2188
2189template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2190 class ARG4, class ARG5, class ARG6, class ARG7,
2191 class ARG8, class ARG9, class ARG10>
2192inline
2193void
2194ScalarPrimitives::construct(TARGET_TYPE *address,
2195 const ARG1& a1,
2196 const ARG2& a2,
2197 const ARG3& a3,
2198 const ARG4& a4,
2199 const ARG5& a5,
2200 const ARG6& a6,
2201 const ARG7& a7,
2202 const ARG8& a8,
2203 const ARG9& a9,
2204 const ARG10& a10,
2205 void *)
2206{
2207 BSLS_ASSERT_SAFE(address);
2208
2209 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
2211}
2212
2213template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2214 class ARG4, class ARG5, class ARG6, class ARG7,
2215 class ARG8, class ARG9, class ARG10, class ARG11>
2216inline
2217void
2218ScalarPrimitives::construct(TARGET_TYPE *address,
2219 const ARG1& a1,
2220 const ARG2& a2,
2221 const ARG3& a3,
2222 const ARG4& a4,
2223 const ARG5& a5,
2224 const ARG6& a6,
2225 const ARG7& a7,
2226 const ARG8& a8,
2227 const ARG9& a9,
2228 const ARG10& a10,
2229 const ARG11& a11,
2230 bslma::Allocator *allocator)
2231{
2232 BSLS_ASSERT_SAFE(address);
2233
2234 enum {
2240 };
2241 Imp::construct(address,
2242 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11,
2243 allocator,
2245}
2246
2247template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2248 class ARG4, class ARG5, class ARG6, class ARG7,
2249 class ARG8, class ARG9, class ARG10, class ARG11>
2250inline
2251void
2252ScalarPrimitives::construct(TARGET_TYPE *address,
2253 const ARG1& a1,
2254 const ARG2& a2,
2255 const ARG3& a3,
2256 const ARG4& a4,
2257 const ARG5& a5,
2258 const ARG6& a6,
2259 const ARG7& a7,
2260 const ARG8& a8,
2261 const ARG9& a9,
2262 const ARG10& a10,
2263 const ARG11& a11,
2264 void *)
2265{
2266 BSLS_ASSERT_SAFE(address);
2267
2268 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
2270}
2271
2272template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2273 class ARG4, class ARG5, class ARG6, class ARG7,
2274 class ARG8, class ARG9, class ARG10, class ARG11,
2275 class ARG12>
2276inline
2277void
2278ScalarPrimitives::construct(TARGET_TYPE *address,
2279 const ARG1& a1,
2280 const ARG2& a2,
2281 const ARG3& a3,
2282 const ARG4& a4,
2283 const ARG5& a5,
2284 const ARG6& a6,
2285 const ARG7& a7,
2286 const ARG8& a8,
2287 const ARG9& a9,
2288 const ARG10& a10,
2289 const ARG11& a11,
2290 const ARG12& a12,
2291 bslma::Allocator *allocator)
2292{
2293 BSLS_ASSERT_SAFE(address);
2294
2295 enum {
2301 };
2302 Imp::construct(address,
2303 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12,
2304 allocator,
2306}
2307
2308template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2309 class ARG4, class ARG5, class ARG6, class ARG7,
2310 class ARG8, class ARG9, class ARG10, class ARG11,
2311 class ARG12>
2312inline
2313void
2314ScalarPrimitives::construct(TARGET_TYPE *address,
2315 const ARG1& a1,
2316 const ARG2& a2,
2317 const ARG3& a3,
2318 const ARG4& a4,
2319 const ARG5& a5,
2320 const ARG6& a6,
2321 const ARG7& a7,
2322 const ARG8& a8,
2323 const ARG9& a9,
2324 const ARG10& a10,
2325 const ARG11& a11,
2326 const ARG12& a12,
2327 void *)
2328{
2329 BSLS_ASSERT_SAFE(address);
2330
2331 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9,
2332 a10, a11, a12);
2334}
2335
2336template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2337 class ARG4, class ARG5, class ARG6, class ARG7,
2338 class ARG8, class ARG9, class ARG10, class ARG11,
2339 class ARG12, class ARG13>
2340inline
2341void
2342ScalarPrimitives::construct(TARGET_TYPE *address,
2343 const ARG1& a1,
2344 const ARG2& a2,
2345 const ARG3& a3,
2346 const ARG4& a4,
2347 const ARG5& a5,
2348 const ARG6& a6,
2349 const ARG7& a7,
2350 const ARG8& a8,
2351 const ARG9& a9,
2352 const ARG10& a10,
2353 const ARG11& a11,
2354 const ARG12& a12,
2355 const ARG13& a13,
2356 bslma::Allocator *allocator)
2357{
2358 BSLS_ASSERT_SAFE(address);
2359
2360 enum {
2366 };
2367 Imp::construct(address,
2368 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13,
2369 allocator,
2371}
2372
2373template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2374 class ARG4, class ARG5, class ARG6, class ARG7,
2375 class ARG8, class ARG9, class ARG10, class ARG11,
2376 class ARG12, class ARG13>
2377inline
2378void
2379ScalarPrimitives::construct(TARGET_TYPE *address,
2380 const ARG1& a1,
2381 const ARG2& a2,
2382 const ARG3& a3,
2383 const ARG4& a4,
2384 const ARG5& a5,
2385 const ARG6& a6,
2386 const ARG7& a7,
2387 const ARG8& a8,
2388 const ARG9& a9,
2389 const ARG10& a10,
2390 const ARG11& a11,
2391 const ARG12& a12,
2392 const ARG13& a13,
2393 void *)
2394{
2395 BSLS_ASSERT_SAFE(address);
2396
2397 ::new (address) TARGET_TYPE(
2398 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
2400}
2401
2402template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2403 class ARG4, class ARG5, class ARG6, class ARG7,
2404 class ARG8, class ARG9, class ARG10, class ARG11,
2405 class ARG12, class ARG13, class ARG14>
2406inline
2407void
2408ScalarPrimitives::construct(TARGET_TYPE *address,
2409 const ARG1& a1,
2410 const ARG2& a2,
2411 const ARG3& a3,
2412 const ARG4& a4,
2413 const ARG5& a5,
2414 const ARG6& a6,
2415 const ARG7& a7,
2416 const ARG8& a8,
2417 const ARG9& a9,
2418 const ARG10& a10,
2419 const ARG11& a11,
2420 const ARG12& a12,
2421 const ARG13& a13,
2422 const ARG14& a14,
2423 bslma::Allocator *allocator)
2424{
2425 BSLS_ASSERT_SAFE(address);
2426
2427 enum {
2433 };
2434 Imp::construct(address,
2435 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
2436 allocator,
2438}
2439
2440template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2441 class ARG4, class ARG5, class ARG6, class ARG7,
2442 class ARG8, class ARG9, class ARG10, class ARG11,
2443 class ARG12, class ARG13, class ARG14>
2444inline
2445void
2446ScalarPrimitives::construct(TARGET_TYPE *address,
2447 const ARG1& a1,
2448 const ARG2& a2,
2449 const ARG3& a3,
2450 const ARG4& a4,
2451 const ARG5& a5,
2452 const ARG6& a6,
2453 const ARG7& a7,
2454 const ARG8& a8,
2455 const ARG9& a9,
2456 const ARG10& a10,
2457 const ARG11& a11,
2458 const ARG12& a12,
2459 const ARG13& a13,
2460 const ARG14& a14,
2461 void *)
2462{
2463 BSLS_ASSERT_SAFE(address);
2464
2465 ::new (address) TARGET_TYPE(
2466 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
2468}
2469
2470} // close package namespace
2471
2472 // *** destruct overloads: ***
2473
2474#ifndef BDE_OMIT_INTERNAL_DEPRECATED
2475
2476namespace bslalg {
2477
2478template <class TARGET_TYPE>
2479inline
2480void ScalarPrimitives::destruct(TARGET_TYPE *address, void *)
2481{
2482 bslma::DestructionUtil::destroy(address);
2483}
2484
2485template <class TARGET_TYPE>
2486inline
2487void ScalarPrimitives::destruct(TARGET_TYPE *address)
2488{
2489 bslma::DestructionUtil::destroy(address);
2490}
2491
2492} // close package namespace
2493
2494#endif // BDE_OMIT_INTERNAL_DEPRECATED
2495
2496namespace bslalg {
2497
2498 // *** swap overloads: ***
2499
2500template <class LHS_TYPE, class RHS_TYPE>
2511
2512 // ---------------------------
2513 // struct ScalarPrimitives_Imp
2514 // ---------------------------
2515
2516// CLASS METHODS
2517template <class TARGET_TYPE>
2518inline
2519TARGET_TYPE *ScalarPrimitives_Imp::unconst(const TARGET_TYPE *pointer)
2520{
2521 return const_cast<TARGET_TYPE *>(pointer);
2522}
2523
2524 // *** defaultConstruct overloads: ***
2525
2526template <class TARGET_TYPE>
2527inline
2528void
2530 TARGET_TYPE *address,
2531 bslma::Allocator *allocator,
2533{
2534 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator);
2536}
2537
2538template <class TARGET_TYPE>
2539inline
2540void
2542 TARGET_TYPE *address,
2543 bslma::Allocator *allocator,
2545{
2546 ::new (address) TARGET_TYPE(allocator);
2548}
2549
2550template <class TARGET_TYPE>
2551inline
2552void
2562
2563template <class TARGET_TYPE>
2564inline
2565void
2567 TARGET_TYPE *address,
2570{
2571 ::new (address) TARGET_TYPE();
2573}
2574
2575template <class TARGET_TYPE>
2576inline
2577void
2579 TARGET_TYPE *address,
2581{
2584 // Detectable at compile-time, this condition ensures that we don't
2585 // call library functions for fundamental or pointer types. Note that
2586 // assignment can't throw.
2587
2588 ::new (address) TARGET_TYPE();
2590 } else {
2591 memset(reinterpret_cast<char *>(address), 0, sizeof *address);
2592 }
2593}
2594
2595template <class TARGET_TYPE>
2596inline
2597void
2599 TARGET_TYPE *address,
2601{
2602 ::new (address) TARGET_TYPE();
2604}
2605
2606 // *** copyConstruct overloads: ***
2607
2608template <class TARGET_TYPE>
2609inline
2610void
2612 TARGET_TYPE *address,
2613 const TARGET_TYPE& original,
2614 bslma::Allocator *allocator,
2616{
2617 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, original);
2619}
2620
2621template <class TARGET_TYPE>
2622inline
2623void
2625 TARGET_TYPE *address,
2626 const TARGET_TYPE& original,
2627 bslma::Allocator *allocator,
2629{
2630 ::new (address) TARGET_TYPE(original, allocator);
2632}
2633
2634template <class TARGET_TYPE>
2635inline
2636void
2638 TARGET_TYPE *address,
2639 const TARGET_TYPE& original,
2642{
2645 // Detectable at compile-time, this condition ensures that we don't
2646 // call library functions for fundamental or pointer types. Note that
2647 // copy-constructor can't throw, and that assignment (although would
2648 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2649 // is 'const'-qualified.
2650
2651 ::new (address) TARGET_TYPE(original);
2653 } else {
2654#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2655#pragma GCC diagnostic push
2656#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2657#endif
2658 memcpy((void *)address,
2659 BSLS_UTIL_ADDRESSOF(original),
2660 sizeof original);
2661#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2662#pragma GCC diagnostic pop
2663#endif
2664 }
2665}
2666
2667template <class TARGET_TYPE>
2668inline
2669void
2671 TARGET_TYPE *address,
2672 const TARGET_TYPE& original,
2675{
2676 ::new (address) TARGET_TYPE(original);
2678}
2679
2680template <class TARGET_TYPE>
2681inline
2682void
2684 TARGET_TYPE *address,
2685 const TARGET_TYPE& original,
2687{
2690 // Detectable at compile-time, this condition ensures that we don't
2691 // call library functions for fundamental or pointer types. Note that
2692 // copy-constructor can't throw, and that assignment (although would
2693 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2694 // is 'const'-qualified.
2695
2696 ::new (address) TARGET_TYPE(original);
2698 } else {
2699#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2700#pragma GCC diagnostic push
2701#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2702#endif
2703 memcpy((void *)address,
2704 BSLS_UTIL_ADDRESSOF(original),
2705 sizeof original);
2706#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2707#pragma GCC diagnostic pop
2708#endif
2709 }
2710}
2711
2712template <class TARGET_TYPE>
2713inline
2714void
2716 TARGET_TYPE *address,
2717 const TARGET_TYPE& original,
2719{
2720 ::new (address) TARGET_TYPE(original);
2722}
2723
2724 // *** moveConstruct overloads: ***
2725
2726template <class TARGET_TYPE>
2727inline
2728void
2730 TARGET_TYPE *address,
2731 TARGET_TYPE& original,
2732 bslma::Allocator *allocator,
2734{
2735 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator,
2736 bslmf::MovableRefUtil::move(original));
2737}
2738
2739template <class TARGET_TYPE>
2740inline
2741void
2743 TARGET_TYPE *address,
2744 TARGET_TYPE& original,
2745 bslma::Allocator *allocator,
2747{
2748 ::new (address) TARGET_TYPE(bslmf::MovableRefUtil::move(original),
2749 allocator);
2750}
2751
2752template <class TARGET_TYPE>
2753inline
2754void
2756 TARGET_TYPE *address,
2757 TARGET_TYPE& original,
2760{
2763 // Detectable at compile-time, this condition ensures that we don't
2764 // call library functions for fundamental or pointer types. Note that
2765 // copy-constructor can't throw, and that assignment (although would
2766 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2767 // is 'const'-qualified.
2768
2769 ::new (address) TARGET_TYPE(original);
2770 } else {
2771#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2772#pragma GCC diagnostic push
2773#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2774#endif
2775 memcpy(address, BSLS_UTIL_ADDRESSOF(original), sizeof original);
2776#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2777#pragma GCC diagnostic pop
2778#endif
2779 }
2780}
2781
2782template <class TARGET_TYPE>
2783inline
2784void
2786 TARGET_TYPE *address,
2787 TARGET_TYPE& original,
2790{
2791 ::new (address) TARGET_TYPE(bslmf::MovableRefUtil::move(original));
2792}
2793
2794template <class TARGET_TYPE>
2795inline
2796void
2798 TARGET_TYPE *address,
2799 TARGET_TYPE& original,
2801{
2804 // Detectable at compile-time, this condition ensures that we don't
2805 // call library functions for fundamental or pointer types. Note that
2806 // move-constructor can't throw, and that assignment (although would
2807 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2808 // is 'const'-qualified.
2809
2810 ::new (address) TARGET_TYPE(original);
2811 } else {
2812#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2813#pragma GCC diagnostic push
2814#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2815#endif
2816 memcpy((void *)address,
2817 BSLS_UTIL_ADDRESSOF(original),
2818 sizeof original);
2819#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2820#pragma GCC diagnostic pop
2821#endif
2822 }
2823}
2824
2825template <class TARGET_TYPE>
2826inline
2827void
2829 TARGET_TYPE *address,
2830 TARGET_TYPE& original,
2832{
2833 ::new (address) TARGET_TYPE(bslmf::MovableRefUtil::move(original));
2834}
2835
2836 // *** destructiveMove overloads: ***
2837
2838template <class TARGET_TYPE, class ALLOCATOR>
2839inline
2840void
2842 TARGET_TYPE *address,
2843 TARGET_TYPE *original,
2844 ALLOCATOR *,
2846{
2849 // Detectable at compile-time, this condition ensures that we don't
2850 // call library functions for fundamental or pointer types. Note that
2851 // copy-constructor can't throw, and that assignment (although would
2852 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2853 // is 'const'-qualified.
2854
2855 ::new (address) TARGET_TYPE(*original);
2857 } else {
2858#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2859#pragma GCC diagnostic push
2860#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2861#endif
2862 memcpy((void *)address, original, sizeof *original); // no overlap
2863#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2864#pragma GCC diagnostic pop
2865#endif
2866 }
2867}
2868
2869template <class TARGET_TYPE, class ALLOCATOR>
2870inline
2871void
2873 TARGET_TYPE *address,
2874 TARGET_TYPE *original,
2875 ALLOCATOR *allocator,
2877{
2878 ScalarPrimitives::moveConstruct(address, *original, allocator);
2879 bslma::DestructionUtil::destroy(original);
2880}
2881
2882 // *** construct overloads: ***
2883
2884template <class TARGET_TYPE, class ARG1>
2885inline
2886void
2888 TARGET_TYPE *address,
2889 const ARG1& a1,
2892{
2895 // Detectable at compile-time, this condition ensures that we don't
2896 // call library functions for fundamental or pointer types. Note that
2897 // copy-constructor can't throw, and that assignment (although would
2898 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2899 // is 'const'-qualified.
2900
2901 ::new (address) TARGET_TYPE(a1);
2903 } else {
2904 BSLMF_ASSERT(sizeof (TARGET_TYPE) == sizeof(a1));
2905 memcpy((void *)address, BSLS_UTIL_ADDRESSOF(a1), sizeof a1);
2906 // no overlap
2907 }
2908}
2909
2910template <class TARGET_TYPE>
2911inline
2912void
2914 TARGET_TYPE *address,
2915 bslma::Allocator *allocator,
2917{
2918 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator);
2920}
2921
2922template <class TARGET_TYPE>
2923inline
2924void
2926 TARGET_TYPE *address,
2927 bslma::Allocator *allocator,
2929{
2930 ::new (address) TARGET_TYPE(allocator);
2932}
2933
2934template <class TARGET_TYPE>
2935inline
2936void
2940{
2941 ::new (address) TARGET_TYPE();
2943}
2944
2945template <class TARGET_TYPE, class ARG1>
2946inline
2947void
2949 TARGET_TYPE *address,
2950 const ARG1& a1,
2951 bslma::Allocator *allocator,
2953{
2954 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1);
2956}
2957
2958template <class TARGET_TYPE, class ARG1>
2959inline
2960void
2962 TARGET_TYPE *address,
2963 const ARG1& a1,
2964 bslma::Allocator *allocator,
2966{
2967 ::new (address) TARGET_TYPE(a1, allocator);
2969}
2970
2971template <class TARGET_TYPE, class ARG1>
2972inline
2973void
2975 const ARG1& a1,
2978{
2979 ::new (address) TARGET_TYPE(a1);
2981}
2982
2983template <class TARGET_TYPE, class ARG1, class ARG2>
2984inline
2985void
2987 TARGET_TYPE *address,
2988 const ARG1& a1,
2989 const ARG2& a2,
2990 bslma::Allocator *allocator,
2992{
2993 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2);
2995}
2996
2997template <class TARGET_TYPE, class ARG1, class ARG2>
2998inline
2999void
3001 TARGET_TYPE *address,
3002 const ARG1& a1,
3003 const ARG2& a2,
3004 bslma::Allocator *allocator,
3006{
3007 ::new (address) TARGET_TYPE(a1, a2, allocator);
3009}
3010
3011template <class TARGET_TYPE, class ARG1, class ARG2>
3012inline
3013void
3015 const ARG1& a1,
3016 const ARG2& a2,
3019{
3020 ::new (address) TARGET_TYPE(a1, a2);
3022}
3023
3024template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
3025inline
3026void
3028 TARGET_TYPE *address,
3029 const ARG1& a1,
3030 const ARG2& a2,
3031 const ARG3& a3,
3032 bslma::Allocator *allocator,
3034{
3035 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3);
3037}
3038
3039template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
3040inline
3041void
3043 TARGET_TYPE *address,
3044 const ARG1& a1,
3045 const ARG2& a2,
3046 const ARG3& a3,
3047 bslma::Allocator *allocator,
3049{
3050 ::new (address) TARGET_TYPE(a1, a2, a3, allocator);
3052}
3053
3054template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
3055inline
3056void
3058 const ARG1& a1,
3059 const ARG2& a2,
3060 const ARG3& a3,
3063{
3064 ::new (address) TARGET_TYPE(a1, a2, a3);
3066}
3067
3068template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3069 class ARG4>
3070inline
3071void
3073 TARGET_TYPE *address,
3074 const ARG1& a1,
3075 const ARG2& a2,
3076 const ARG3& a3,
3077 const ARG4& a4,
3078 bslma::Allocator *allocator,
3080{
3081 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4);
3083}
3084
3085template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3086 class ARG4>
3087inline
3088void
3090 TARGET_TYPE *address,
3091 const ARG1& a1,
3092 const ARG2& a2,
3093 const ARG3& a3,
3094 const ARG4& a4,
3095 bslma::Allocator *allocator,
3097{
3098 ::new (address) TARGET_TYPE(a1, a2, a3, a4, allocator);
3100}
3101
3102template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3103 class ARG4>
3104inline
3105void
3107 const ARG1& a1,
3108 const ARG2& a2,
3109 const ARG3& a3,
3110 const ARG4& a4,
3113{
3114 ::new (address) TARGET_TYPE(a1, a2, a3, a4);
3116}
3117
3118template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3119 class ARG4, class ARG5>
3120inline
3121void
3123 TARGET_TYPE *address,
3124 const ARG1& a1,
3125 const ARG2& a2,
3126 const ARG3& a3,
3127 const ARG4& a4,
3128 const ARG5& a5,
3129 bslma::Allocator *allocator,
3131{
3132 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3133 a5);
3135}
3136
3137template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3138 class ARG4, class ARG5>
3139inline
3140void
3142 TARGET_TYPE *address,
3143 const ARG1& a1,
3144 const ARG2& a2,
3145 const ARG3& a3,
3146 const ARG4& a4,
3147 const ARG5& a5,
3148 bslma::Allocator *allocator,
3150{
3151 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, allocator);
3153}
3154
3155template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3156 class ARG4, class ARG5>
3157inline
3158void
3160 const ARG1& a1,
3161 const ARG2& a2,
3162 const ARG3& a3,
3163 const ARG4& a4,
3164 const ARG5& a5,
3167{
3168 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5);
3170}
3171
3172template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3173 class ARG4, class ARG5, class ARG6>
3174inline
3175void
3177 TARGET_TYPE *address,
3178 const ARG1& a1,
3179 const ARG2& a2,
3180 const ARG3& a3,
3181 const ARG4& a4,
3182 const ARG5& a5,
3183 const ARG6& a6,
3184 bslma::Allocator *allocator,
3186{
3187 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3188 a5, a6);
3190}
3191
3192template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3193 class ARG4, class ARG5, class ARG6>
3194inline
3195void
3197 TARGET_TYPE *address,
3198 const ARG1& a1,
3199 const ARG2& a2,
3200 const ARG3& a3,
3201 const ARG4& a4,
3202 const ARG5& a5,
3203 const ARG6& a6,
3204 bslma::Allocator *allocator,
3206{
3207 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, allocator);
3209}
3210
3211template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3212 class ARG4, class ARG5, class ARG6>
3213inline
3214void
3216 const ARG1& a1,
3217 const ARG2& a2,
3218 const ARG3& a3,
3219 const ARG4& a4,
3220 const ARG5& a5,
3221 const ARG6& a6,
3224{
3225 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6);
3227}
3228
3229template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3230 class ARG4, class ARG5, class ARG6, class ARG7>
3231inline
3232void
3234 TARGET_TYPE *address,
3235 const ARG1& a1,
3236 const ARG2& a2,
3237 const ARG3& a3,
3238 const ARG4& a4,
3239 const ARG5& a5,
3240 const ARG6& a6,
3241 const ARG7& a7,
3242 bslma::Allocator *allocator,
3244{
3245 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3246 a5, a6, a7);
3248}
3249
3250template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3251 class ARG4, class ARG5, class ARG6, class ARG7>
3252inline
3253void
3255 TARGET_TYPE *address,
3256 const ARG1& a1,
3257 const ARG2& a2,
3258 const ARG3& a3,
3259 const ARG4& a4,
3260 const ARG5& a5,
3261 const ARG6& a6,
3262 const ARG7& a7,
3263 bslma::Allocator *allocator,
3265{
3266 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, allocator);
3268}
3269
3270template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3271 class ARG4, class ARG5, class ARG6, class ARG7>
3272inline
3273void
3275 const ARG1& a1,
3276 const ARG2& a2,
3277 const ARG3& a3,
3278 const ARG4& a4,
3279 const ARG5& a5,
3280 const ARG6& a6,
3281 const ARG7& a7,
3284{
3285 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7);
3287}
3288
3289template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3290 class ARG4, class ARG5, class ARG6, class ARG7,
3291 class ARG8>
3292inline
3293void
3295 TARGET_TYPE *address,
3296 const ARG1& a1,
3297 const ARG2& a2,
3298 const ARG3& a3,
3299 const ARG4& a4,
3300 const ARG5& a5,
3301 const ARG6& a6,
3302 const ARG7& a7,
3303 const ARG8& a8,
3304 bslma::Allocator *allocator,
3306{
3307 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3308 a5, a6, a7, a8);
3310}
3311
3312template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3313 class ARG4, class ARG5, class ARG6, class ARG7,
3314 class ARG8>
3315inline
3316void
3318 TARGET_TYPE *address,
3319 const ARG1& a1,
3320 const ARG2& a2,
3321 const ARG3& a3,
3322 const ARG4& a4,
3323 const ARG5& a5,
3324 const ARG6& a6,
3325 const ARG7& a7,
3326 const ARG8& a8,
3327 bslma::Allocator *allocator,
3329{
3330 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, allocator);
3332}
3333
3334template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3335 class ARG4, class ARG5, class ARG6, class ARG7,
3336 class ARG8>
3337inline
3338void
3340 const ARG1& a1,
3341 const ARG2& a2,
3342 const ARG3& a3,
3343 const ARG4& a4,
3344 const ARG5& a5,
3345 const ARG6& a6,
3346 const ARG7& a7,
3347 const ARG8& a8,
3350{
3351 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8);
3353}
3354
3355template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3356 class ARG4, class ARG5, class ARG6, class ARG7,
3357 class ARG8, class ARG9>
3358inline
3359void
3361 TARGET_TYPE *address,
3362 const ARG1& a1,
3363 const ARG2& a2,
3364 const ARG3& a3,
3365 const ARG4& a4,
3366 const ARG5& a5,
3367 const ARG6& a6,
3368 const ARG7& a7,
3369 const ARG8& a8,
3370 const ARG9& a9,
3371 bslma::Allocator *allocator,
3373{
3374 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3375 a5, a6, a7, a8, a9);
3377}
3378
3379template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3380 class ARG4, class ARG5, class ARG6, class ARG7,
3381 class ARG8, class ARG9>
3382inline
3383void
3385 TARGET_TYPE *address,
3386 const ARG1& a1,
3387 const ARG2& a2,
3388 const ARG3& a3,
3389 const ARG4& a4,
3390 const ARG5& a5,
3391 const ARG6& a6,
3392 const ARG7& a7,
3393 const ARG8& a8,
3394 const ARG9& a9,
3395 bslma::Allocator *allocator,
3397{
3398 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, allocator);
3400}
3401
3402template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3403 class ARG4, class ARG5, class ARG6, class ARG7,
3404 class ARG8, class ARG9>
3405inline
3406void
3408 const ARG1& a1,
3409 const ARG2& a2,
3410 const ARG3& a3,
3411 const ARG4& a4,
3412 const ARG5& a5,
3413 const ARG6& a6,
3414 const ARG7& a7,
3415 const ARG8& a8,
3416 const ARG9& a9,
3419{
3420 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9);
3422}
3423
3424template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3425 class ARG4, class ARG5, class ARG6, class ARG7,
3426 class ARG8, class ARG9, class ARG10>
3427inline
3428void
3430 TARGET_TYPE *address,
3431 const ARG1& a1,
3432 const ARG2& a2,
3433 const ARG3& a3,
3434 const ARG4& a4,
3435 const ARG5& a5,
3436 const ARG6& a6,
3437 const ARG7& a7,
3438 const ARG8& a8,
3439 const ARG9& a9,
3440 const ARG10& a10,
3441 bslma::Allocator *allocator,
3443{
3444 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3445 a5, a6, a7, a8, a9, a10);
3447}
3448
3449template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3450 class ARG4, class ARG5, class ARG6, class ARG7,
3451 class ARG8, class ARG9, class ARG10>
3452inline
3453void
3455 TARGET_TYPE *address,
3456 const ARG1& a1,
3457 const ARG2& a2,
3458 const ARG3& a3,
3459 const ARG4& a4,
3460 const ARG5& a5,
3461 const ARG6& a6,
3462 const ARG7& a7,
3463 const ARG8& a8,
3464 const ARG9& a9,
3465 const ARG10& a10,
3466 bslma::Allocator *allocator,
3468{
3469 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
3470 allocator);
3472}
3473
3474template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3475 class ARG4, class ARG5, class ARG6, class ARG7,
3476 class ARG8, class ARG9, class ARG10>
3477inline
3478void
3480 const ARG1& a1,
3481 const ARG2& a2,
3482 const ARG3& a3,
3483 const ARG4& a4,
3484 const ARG5& a5,
3485 const ARG6& a6,
3486 const ARG7& a7,
3487 const ARG8& a8,
3488 const ARG9& a9,
3489 const ARG10& a10,
3492{
3493 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
3495}
3496
3497template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3498 class ARG4, class ARG5, class ARG6, class ARG7,
3499 class ARG8, class ARG9, class ARG10, class ARG11>
3500inline
3501void
3503 TARGET_TYPE *address,
3504 const ARG1& a1,
3505 const ARG2& a2,
3506 const ARG3& a3,
3507 const ARG4& a4,
3508 const ARG5& a5,
3509 const ARG6& a6,
3510 const ARG7& a7,
3511 const ARG8& a8,
3512 const ARG9& a9,
3513 const ARG10& a10,
3514 const ARG11& a11,
3515 bslma::Allocator *allocator,
3517{
3518 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3519 a5, a6, a7, a8, a9, a10, a11);
3521}
3522
3523template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3524 class ARG4, class ARG5, class ARG6, class ARG7,
3525 class ARG8, class ARG9, class ARG10, class ARG11>
3526inline
3527void
3529 TARGET_TYPE *address,
3530 const ARG1& a1,
3531 const ARG2& a2,
3532 const ARG3& a3,
3533 const ARG4& a4,
3534 const ARG5& a5,
3535 const ARG6& a6,
3536 const ARG7& a7,
3537 const ARG8& a8,
3538 const ARG9& a9,
3539 const ARG10& a10,
3540 const ARG11& a11,
3541 bslma::Allocator *allocator,
3543{
3544 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11,
3545 allocator);
3547}
3548
3549template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3550 class ARG4, class ARG5, class ARG6, class ARG7,
3551 class ARG8, class ARG9, class ARG10, class ARG11>
3552inline
3553void
3555 const ARG1& a1,
3556 const ARG2& a2,
3557 const ARG3& a3,
3558 const ARG4& a4,
3559 const ARG5& a5,
3560 const ARG6& a6,
3561 const ARG7& a7,
3562 const ARG8& a8,
3563 const ARG9& a9,
3564 const ARG10& a10,
3565 const ARG11& a11,
3568{
3569 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
3571}
3572
3573template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3574 class ARG4, class ARG5, class ARG6, class ARG7,
3575 class ARG8, class ARG9, class ARG10, class ARG11,
3576 class ARG12>
3577inline
3578void
3580 TARGET_TYPE *address,
3581 const ARG1& a1,
3582 const ARG2& a2,
3583 const ARG3& a3,
3584 const ARG4& a4,
3585 const ARG5& a5,
3586 const ARG6& a6,
3587 const ARG7& a7,
3588 const ARG8& a8,
3589 const ARG9& a9,
3590 const ARG10& a10,
3591 const ARG11& a11,
3592 const ARG12& a12,
3593 bslma::Allocator *allocator,
3595{
3596 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3597 a5, a6, a7, a8, a9, a10, a11, a12);
3599}
3600
3601template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3602 class ARG4, class ARG5, class ARG6, class ARG7,
3603 class ARG8, class ARG9, class ARG10, class ARG11,
3604 class ARG12>
3605inline
3606void
3608 TARGET_TYPE *address,
3609 const ARG1& a1,
3610 const ARG2& a2,
3611 const ARG3& a3,
3612 const ARG4& a4,
3613 const ARG5& a5,
3614 const ARG6& a6,
3615 const ARG7& a7,
3616 const ARG8& a8,
3617 const ARG9& a9,
3618 const ARG10& a10,
3619 const ARG11& a11,
3620 const ARG12& a12,
3621 bslma::Allocator *allocator,
3623{
3624 ::new (address) TARGET_TYPE(
3625 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12,
3626 allocator);
3628}
3629
3630template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3631 class ARG4, class ARG5, class ARG6, class ARG7,
3632 class ARG8, class ARG9, class ARG10, class ARG11,
3633 class ARG12>
3634inline
3635void
3637 const ARG1& a1,
3638 const ARG2& a2,
3639 const ARG3& a3,
3640 const ARG4& a4,
3641 const ARG5& a5,
3642 const ARG6& a6,
3643 const ARG7& a7,
3644 const ARG8& a8,
3645 const ARG9& a9,
3646 const ARG10& a10,
3647 const ARG11& a11,
3648 const ARG12& a12,
3651{
3652 ::new (address) TARGET_TYPE(
3653 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
3655}
3656
3657template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3658 class ARG4, class ARG5, class ARG6, class ARG7,
3659 class ARG8, class ARG9, class ARG10, class ARG11,
3660 class ARG12, class ARG13>
3661inline
3662void
3664 TARGET_TYPE *address,
3665 const ARG1& a1,
3666 const ARG2& a2,
3667 const ARG3& a3,
3668 const ARG4& a4,
3669 const ARG5& a5,
3670 const ARG6& a6,
3671 const ARG7& a7,
3672 const ARG8& a8,
3673 const ARG9& a9,
3674 const ARG10& a10,
3675 const ARG11& a11,
3676 const ARG12& a12,
3677 const ARG13& a13,
3678 bslma::Allocator *allocator,
3680{
3681 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3682 a5, a6, a7, a8, a9, a10, a11, a12, a13);
3684}
3685
3686template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3687 class ARG4, class ARG5, class ARG6, class ARG7,
3688 class ARG8, class ARG9, class ARG10, class ARG11,
3689 class ARG12, class ARG13>
3690inline
3691void
3693 TARGET_TYPE *address,
3694 const ARG1& a1,
3695 const ARG2& a2,
3696 const ARG3& a3,
3697 const ARG4& a4,
3698 const ARG5& a5,
3699 const ARG6& a6,
3700 const ARG7& a7,
3701 const ARG8& a8,
3702 const ARG9& a9,
3703 const ARG10& a10,
3704 const ARG11& a11,
3705 const ARG12& a12,
3706 const ARG13& a13,
3707 bslma::Allocator *allocator,
3709{
3710 ::new (address) TARGET_TYPE(
3711 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13,
3712 allocator);
3714}
3715
3716template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3717 class ARG4, class ARG5, class ARG6, class ARG7,
3718 class ARG8, class ARG9, class ARG10, class ARG11,
3719 class ARG12, class ARG13>
3720inline
3721void
3723 const ARG1& a1,
3724 const ARG2& a2,
3725 const ARG3& a3,
3726 const ARG4& a4,
3727 const ARG5& a5,
3728 const ARG6& a6,
3729 const ARG7& a7,
3730 const ARG8& a8,
3731 const ARG9& a9,
3732 const ARG10& a10,
3733 const ARG11& a11,
3734 const ARG12& a12,
3735 const ARG13& a13,
3738{
3739 ::new (address) TARGET_TYPE(
3740 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
3742}
3743
3744template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3745 class ARG4, class ARG5, class ARG6, class ARG7,
3746 class ARG8, class ARG9, class ARG10, class ARG11,
3747 class ARG12, class ARG13, class ARG14>
3748inline
3749void
3751 TARGET_TYPE *address,
3752 const ARG1& a1,
3753 const ARG2& a2,
3754 const ARG3& a3,
3755 const ARG4& a4,
3756 const ARG5& a5,
3757 const ARG6& a6,
3758 const ARG7& a7,
3759 const ARG8& a8,
3760 const ARG9& a9,
3761 const ARG10& a10,
3762 const ARG11& a11,
3763 const ARG12& a12,
3764 const ARG13& a13,
3765 const ARG14& a14,
3766 bslma::Allocator *allocator,
3768{
3769 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3770 a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
3772}
3773
3774template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3775 class ARG4, class ARG5, class ARG6, class ARG7,
3776 class ARG8, class ARG9, class ARG10, class ARG11,
3777 class ARG12, class ARG13, class ARG14>
3778inline
3779void
3781 TARGET_TYPE *address,
3782 const ARG1& a1,
3783 const ARG2& a2,
3784 const ARG3& a3,
3785 const ARG4& a4,
3786 const ARG5& a5,
3787 const ARG6& a6,
3788 const ARG7& a7,
3789 const ARG8& a8,
3790 const ARG9& a9,
3791 const ARG10& a10,
3792 const ARG11& a11,
3793 const ARG12& a12,
3794 const ARG13& a13,
3795 const ARG14& a14,
3796 bslma::Allocator *allocator,
3798{
3799 ::new (address) TARGET_TYPE(
3800 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
3801 allocator);
3803}
3804
3805template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3806 class ARG4, class ARG5, class ARG6, class ARG7,
3807 class ARG8, class ARG9, class ARG10, class ARG11,
3808 class ARG12, class ARG13, class ARG14>
3809inline
3810void
3812 const ARG1& a1,
3813 const ARG2& a2,
3814 const ARG3& a3,
3815 const ARG4& a4,
3816 const ARG5& a5,
3817 const ARG6& a6,
3818 const ARG7& a7,
3819 const ARG8& a8,
3820 const ARG9& a9,
3821 const ARG10& a10,
3822 const ARG11& a11,
3823 const ARG12& a12,
3824 const ARG13& a13,
3825 const ARG14& a14,
3828{
3829 ::new (address) TARGET_TYPE(
3830 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
3832}
3833
3834 // *** swap overloads: ***
3835
3836template <class LHS_TYPE, class RHS_TYPE>
3838 LHS_TYPE& lhs,
3839 RHS_TYPE& rhs,
3841{
3847 // Detectable at compile-time, this condition ensures that we don't
3848 // call library functions for fundamental types. It also ensures we
3849 // don't bitwise swap types that use allocators, as there is no easy
3850 // way to confirm allocators are the same for an arbitrary 'LHS_TYPE'.
3851 // Note that assignment can throw only for types that use allocators.
3852
3853 char arena[sizeof lhs];
3854 memcpy(arena, BSLS_UTIL_ADDRESSOF(lhs), sizeof lhs);
3855 memcpy((void *)BSLS_UTIL_ADDRESSOF(lhs),
3857 sizeof lhs); // no overlap, or identical
3858 memcpy((void *)BSLS_UTIL_ADDRESSOF(rhs), arena, sizeof lhs);
3859 } else {
3860 LHS_TYPE temp(lhs);
3861 lhs = rhs;
3862 rhs = temp;
3863 }
3864}
3865
3866template <class LHS_TYPE, class RHS_TYPE>
3868 RHS_TYPE& rhs,
3870{
3871 LHS_TYPE temp(lhs);
3872 lhs = rhs;
3873 rhs = temp;
3874}
3875
3876} // close package namespace
3877
3878#ifndef BDE_OPENSOURCE_PUBLICATION // BACKWARD_COMPATIBILITY
3879// ============================================================================
3880// BACKWARD COMPATIBILITY
3881// ============================================================================
3882
3883/// This alias is defined for backward compatibility.
3885#endif // BDE_OPENSOURCE_PUBLICATION -- BACKWARD_COMPATIBILITY
3886
3887
3888
3889#endif
3890
3891// ----------------------------------------------------------------------------
3892// Copyright 2013 Bloomberg Finance L.P.
3893//
3894// Licensed under the Apache License, Version 2.0 (the "License");
3895// you may not use this file except in compliance with the License.
3896// You may obtain a copy of the License at
3897//
3898// http://www.apache.org/licenses/LICENSE-2.0
3899//
3900// Unless required by applicable law or agreed to in writing, software
3901// distributed under the License is distributed on an "AS IS" BASIS,
3902// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3903// See the License for the specific language governing permissions and
3904// limitations under the License.
3905// ----------------------------- END-OF-FILE ----------------------------------
3906
3907/** @} */
3908/** @} */
3909/** @} */
#define BSLALG_SCALARPRIMITIVES_XLC_PLACEMENT_NEW_FIX
Definition bslalg_scalarprimitives.h:1565
Definition bslma_allocator.h:545
bslalg::ScalarPrimitives bslalg_ScalarPrimitives
This alias is defined for backward compatibility.
Definition bslalg_scalarprimitives.h:3884
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1917
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_KEYWORD_CONSTEXPR_CPP17
Definition bsls_keyword.h:639
#define BSLS_UTIL_ADDRESSOF(OBJ)
Definition bsls_util.h:296
Definition bdlc_flathashmap.h:2218
Definition bslmf_integralconstant.h:261
Definition bslmf_isfundamental.h:330
Definition bslmf_ispointer.h:138
Definition bslmf_issame.h:146
Definition bslmf_istriviallydefaultconstructible.h:296
Definition bslalg_scalarprimitives.h:683
static void copyConstruct(TARGET_TYPE *address, const TARGET_TYPE &original, bslma::Allocator *allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_ARG_T_TRAITS > *)
Definition bslalg_scalarprimitives.h:2611
static void defaultConstruct(TARGET_TYPE *address, bslma::Allocator *allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_ARG_T_TRAITS > *)
Definition bslalg_scalarprimitives.h:2529
static void construct(TARGET_TYPE *address, const ARG1 &a1, bslma::Allocator *allocator, bsl::integral_constant< int, e_BITWISE_COPYABLE_TRAITS > *)
Definition bslalg_scalarprimitives.h:2887
static void swap(LHS_TYPE &lhs, RHS_TYPE &rhs, bsl::integral_constant< int, e_BITWISE_MOVEABLE_TRAITS > *)
Definition bslalg_scalarprimitives.h:3837
static TARGET_TYPE * unconst(const TARGET_TYPE *pointer)
Definition bslalg_scalarprimitives.h:2519
@ e_USES_ALLOCATOR_ARG_T_TRAITS
Definition bslalg_scalarprimitives.h:691
@ e_HAS_TRIVIAL_DEFAULT_CTOR_TRAITS
Definition bslalg_scalarprimitives.h:693
@ e_BITWISE_MOVEABLE_TRAITS
Definition bslalg_scalarprimitives.h:695
@ e_BITWISE_COPYABLE_TRAITS
Definition bslalg_scalarprimitives.h:694
@ e_USES_BSLMA_ALLOCATOR_TRAITS
Definition bslalg_scalarprimitives.h:692
@ e_NIL_TRAITS
Definition bslalg_scalarprimitives.h:696
static void destructiveMove(TARGET_TYPE *address, TARGET_TYPE *original, ALLOCATOR *allocator, bsl::integral_constant< int, e_BITWISE_MOVEABLE_TRAITS > *)
Definition bslalg_scalarprimitives.h:2841
static void moveConstruct(TARGET_TYPE *address, TARGET_TYPE &original, bslma::Allocator *allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_ARG_T_TRAITS > *)
Definition bslalg_scalarprimitives.h:2729
Definition bslalg_scalarprimitives.h:173
static void defaultConstruct(TARGET_TYPE *address, bslma::Allocator *allocator)
Definition bslalg_scalarprimitives.h:1577
static void moveConstruct(TARGET_TYPE *address, TARGET_TYPE &original, bslma::Allocator *allocator)
Definition bslalg_scalarprimitives.h:1660
static void destruct(TARGET_TYPE *object, void *allocator)
Definition bslalg_scalarprimitives.h:2480
static void destructiveMove(TARGET_TYPE *address, TARGET_TYPE *original, ALLOCATOR *allocator)
Definition bslalg_scalarprimitives.h:1703
static void copyConstruct(TARGET_TYPE *address, const TARGET_TYPE &original, bslma::Allocator *allocator)
Definition bslalg_scalarprimitives.h:1617
static void construct(TARGET_TYPE *address, bslma::Allocator *allocator)
Definition bslalg_scalarprimitives.h:1726
static void swap(LHS_TYPE &lhs, RHS_TYPE &rhs)
Definition bslalg_scalarprimitives.h:2501
Definition bslma_usesbslmaallocator.h:344
Definition bslmf_isbitwisecopyable.h:298
Definition bslmf_isbitwisemoveable.h:718
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1067
Definition bslmf_usesallocatorargt.h:100