BDE 4.14.0 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_platform.h>
144#include <bsls_util.h>
145
146#include <stddef.h>
147#include <string.h>
148
149#include <new> // placement 'new'
150
151#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
152#include <bslmf_removecvq.h>
153#endif
154
155
156
157namespace bslalg {
158
159struct ScalarPrimitives_Imp;
160
161 // =======================
162 // struct ScalarPrimitives
163 // =======================
164
165/// This `struct` provides a namespace for a suite of utility functions that
166/// operate on elements of a parameterized type `TARGET_TYPE`. If any of
167/// the `...Construct` methods throws, then its target `address` is left
168/// uninitialized and there are no effects, unless otherwise mentioned in
169/// the documentation.
171
172 private:
173 // PRIVATE TYPES
175
176 public:
177 // CLASS METHODS
178
179 /// Build a default-initialized object of the parameterized
180 /// `TARGET_TYPE` in the uninitialized memory at the specified
181 /// `address`, as if by using the `TARGET_TYPE` default constructor. If
182 /// the specified `allocator` is based on `bslma::Allocator` and
183 /// `TARGET_TYPE` takes an allocator constructor argument, then
184 /// `allocator` is passed to the default constructor. If the
185 /// constructor throws, the `address` is left in an uninitialized state.
186 /// Note that this operation may bypass the constructor and simply fill
187 /// memory with 0 if `TARGET_TYPE` has the trivial default constructor
188 /// trait and does not use `bslma::Allocator`.
189 template <class TARGET_TYPE>
190 static void defaultConstruct(TARGET_TYPE *address,
191 bslma::Allocator *allocator);
192 template <class TARGET_TYPE>
193 static void defaultConstruct(TARGET_TYPE *address,
194 void *allocator);
195
196 /// Build an object of the parameterized `TARGET_TYPE` from the
197 /// specified `original` object of the same `TARGET_TYPE` in the
198 /// uninitialized memory at the specified `address`, as if by using the
199 /// copy constructor of `TARGET_TYPE`. If the specified `allocator` is
200 /// based on `bslma::Allocator` and `TARGET_TYPE` takes an allocator
201 /// constructor argument, then `allocator` is passed to the copy
202 /// constructor. If the constructor throws, the `address` is left in an
203 /// uninitialized state. Note that bit-wise copy will be used if
204 /// `TARGET_TYPE` has the bit-wise copyable trait.
205 template <class TARGET_TYPE>
206 static void copyConstruct(TARGET_TYPE *address,
207 const TARGET_TYPE& original,
208 bslma::Allocator *allocator);
209 template <class TARGET_TYPE>
210 static void copyConstruct(TARGET_TYPE *address,
211 const TARGET_TYPE& original,
212 void *allocator);
213
214 /// Build an object of the parameterized `TARGET_TYPE` from the
215 /// specified `original` object of the same `TARGET_TYPE` in the
216 /// uninitialized memory at the specified `address`, as if by using the
217 /// move constructor of `TARGET_TYPE`. If the specified `allocator` is
218 /// based on `bslma::Allocator` and `TARGET_TYPE` takes an allocator
219 /// constructor argument, then `allocator` is passed to the move
220 /// constructor. If the constructor throws, the `address` is left in
221 /// an uninitialized state. Note that bit-wise copy will be used if
222 /// `TARGET_TYPE` has the bit-wise copyable trait (not the bit-wise
223 /// moveable trait, which indicates a destructive bit-wise move). In
224 /// C++03 mode, `moveConstruct` has the same effect as `copyConstruct`.
225 template <class TARGET_TYPE>
226 static void moveConstruct(TARGET_TYPE *address,
227 TARGET_TYPE& original,
228 bslma::Allocator *allocator);
229 template <class TARGET_TYPE>
230 static void moveConstruct(TARGET_TYPE *address,
231 TARGET_TYPE& original,
232 void *allocator);
233
234 /// Move the state of the object of the parameterized `TARGET_TYPE` from
235 /// the object at the specified `original` address to the uninitialized
236 /// memory at the specified `address`, as if by move constructing and
237 /// then destroying the original. If the parameterized `ALLOCATOR` is
238 /// based on `bslma::Allocator` and `TARGET_TYPE` takes an allocator
239 /// constructor argument, then the moved object uses the specified
240 /// `allocator` to supply memory. If the move constructor throws, the
241 /// `address` is left in an uninitialized state and the `original` is
242 /// left unchanged. The behavior is undefined unless the `original`
243 /// object also uses the `allocator`. Note that bit-wise copy will be
244 /// used and `allocator` will be ignored if TARGET_TYPE' has the
245 /// bit-wise moveable trait. Note that, if `ALLOCATOR` is not based on
246 /// `bslma::Allocator`, then the `allocator` argument is ignored; the
247 /// allocator used by the resulting object at `address` might or might
248 /// not be the same as the allocator used by `original`, depending on
249 /// whether `TARGET_TYPE` has a move constructor (C++11).
250 template <class TARGET_TYPE, class ALLOCATOR>
251 static void destructiveMove(TARGET_TYPE *address,
252 TARGET_TYPE *original,
253 ALLOCATOR *allocator);
254
255 /// Build an object of the parameterized `TARGET_TYPE` in the
256 /// uninitialized memory at the specified `address`. Use the
257 /// `TARGET_TYPE` constructor `TARGET_TYPE(ARG1 const&, ...)` taking the
258 /// specified `a1` up to `a14` arguments of the respective parameterized
259 /// `ARG1` up to `ARG14` types. If the specified `allocator` is based
260 /// on `bslma::Allocator` and `TARGET_TYPE` takes an allocator
261 /// constructor argument, then `allocator` is passed to the
262 /// `TARGET_TYPE` constructor in the manner appropriate to the traits
263 /// `bslmf::UsesAllocatorArgT` and `blsma::UsesBslmaAllocator`.
264 template <class TARGET_TYPE>
265 static void construct(TARGET_TYPE *address,
266 bslma::Allocator *allocator);
267 template <class TARGET_TYPE>
268 static void construct(TARGET_TYPE *address,
269 void *allocator);
270 template <class TARGET_TYPE, class ARG1>
271 static void construct(TARGET_TYPE *address,
272 const ARG1& a1,
273 bslma::Allocator *allocator);
274 template <class TARGET_TYPE, class ARG1>
275 static void construct(TARGET_TYPE *address,
276 const ARG1& a1,
277 void *allocator);
278 template <class TARGET_TYPE, class ARG1, class ARG2>
279 static void construct(TARGET_TYPE *address,
280 const ARG1& a1,
281 const ARG2& a2,
282 bslma::Allocator *allocator);
283 template <class TARGET_TYPE, class ARG1, class ARG2>
284 static void construct(TARGET_TYPE *address,
285 const ARG1& a1,
286 const ARG2& a2,
287 void *allocator);
288 template <class TARGET_TYPE,
289 class ARG1, class ARG2, class ARG3>
290 static void construct(TARGET_TYPE *address,
291 const ARG1& a1,
292 const ARG2& a2,
293 const ARG3& a3,
294 bslma::Allocator *allocator);
295 template <class TARGET_TYPE,
296 class ARG1, class ARG2, class ARG3>
297 static void construct(TARGET_TYPE *address,
298 const ARG1& a1,
299 const ARG2& a2,
300 const ARG3& a3,
301 void *allocator);
302 template <class TARGET_TYPE,
303 class ARG1, class ARG2, class ARG3, class ARG4>
304 static void construct(TARGET_TYPE *address,
305 const ARG1& a1,
306 const ARG2& a2,
307 const ARG3& a3,
308 const ARG4& a4,
309 bslma::Allocator *allocator);
310 template <class TARGET_TYPE,
311 class ARG1, class ARG2, class ARG3, class ARG4>
312 static void construct(TARGET_TYPE *address,
313 const ARG1& a1,
314 const ARG2& a2,
315 const ARG3& a3,
316 const ARG4& a4,
317 void *allocator);
318 template <class TARGET_TYPE,
319 class ARG1, class ARG2, class ARG3, class ARG4,
320 class ARG5>
321 static void construct(TARGET_TYPE *address,
322 const ARG1& a1,
323 const ARG2& a2,
324 const ARG3& a3,
325 const ARG4& a4,
326 const ARG5& a5,
327 bslma::Allocator *allocator);
328 template <class TARGET_TYPE,
329 class ARG1, class ARG2, class ARG3, class ARG4,
330 class ARG5>
331 static void construct(TARGET_TYPE *address,
332 const ARG1& a1,
333 const ARG2& a2,
334 const ARG3& a3,
335 const ARG4& a4,
336 const ARG5& a5,
337 void *allocator);
338 template <class TARGET_TYPE,
339 class ARG1, class ARG2, class ARG3, class ARG4,
340 class ARG5, class ARG6>
341 static void construct(TARGET_TYPE *address,
342 const ARG1& a1,
343 const ARG2& a2,
344 const ARG3& a3,
345 const ARG4& a4,
346 const ARG5& a5,
347 const ARG6& a6,
348 bslma::Allocator *allocator);
349 template <class TARGET_TYPE,
350 class ARG1, class ARG2, class ARG3, class ARG4,
351 class ARG5, class ARG6>
352 static void construct(TARGET_TYPE *address,
353 const ARG1& a1,
354 const ARG2& a2,
355 const ARG3& a3,
356 const ARG4& a4,
357 const ARG5& a5,
358 const ARG6& a6,
359 void *allocator);
360 template <class TARGET_TYPE,
361 class ARG1, class ARG2, class ARG3, class ARG4,
362 class ARG5, class ARG6, class ARG7>
363 static void construct(TARGET_TYPE *address,
364 const ARG1& a1,
365 const ARG2& a2,
366 const ARG3& a3,
367 const ARG4& a4,
368 const ARG5& a5,
369 const ARG6& a6,
370 const ARG7& a7,
371 bslma::Allocator *allocator);
372 template <class TARGET_TYPE,
373 class ARG1, class ARG2, class ARG3, class ARG4,
374 class ARG5, class ARG6, class ARG7>
375 static void construct(TARGET_TYPE *address,
376 const ARG1& a1,
377 const ARG2& a2,
378 const ARG3& a3,
379 const ARG4& a4,
380 const ARG5& a5,
381 const ARG6& a6,
382 const ARG7& a7,
383 void *allocator);
384 template <class TARGET_TYPE,
385 class ARG1, class ARG2, class ARG3, class ARG4,
386 class ARG5, class ARG6, class ARG7, class ARG8>
387 static void construct(TARGET_TYPE *address,
388 const ARG1& a1,
389 const ARG2& a2,
390 const ARG3& a3,
391 const ARG4& a4,
392 const ARG5& a5,
393 const ARG6& a6,
394 const ARG7& a7,
395 const ARG8& a8,
396 bslma::Allocator *allocator);
397 template <class TARGET_TYPE,
398 class ARG1, class ARG2, class ARG3, class ARG4,
399 class ARG5, class ARG6, class ARG7, class ARG8>
400 static void construct(TARGET_TYPE *address,
401 const ARG1& a1,
402 const ARG2& a2,
403 const ARG3& a3,
404 const ARG4& a4,
405 const ARG5& a5,
406 const ARG6& a6,
407 const ARG7& a7,
408 const ARG8& a8,
409 void *allocator);
410 template <class TARGET_TYPE,
411 class ARG1, class ARG2, class ARG3, class ARG4,
412 class ARG5, class ARG6, class ARG7, class ARG8,
413 class ARG9>
414 static void construct(TARGET_TYPE *address,
415 const ARG1& a1,
416 const ARG2& a2,
417 const ARG3& a3,
418 const ARG4& a4,
419 const ARG5& a5,
420 const ARG6& a6,
421 const ARG7& a7,
422 const ARG8& a8,
423 const ARG9& a9,
424 bslma::Allocator *allocator);
425 template <class TARGET_TYPE,
426 class ARG1, class ARG2, class ARG3, class ARG4,
427 class ARG5, class ARG6, class ARG7, class ARG8,
428 class ARG9>
429 static void construct(TARGET_TYPE *address,
430 const ARG1& a1,
431 const ARG2& a2,
432 const ARG3& a3,
433 const ARG4& a4,
434 const ARG5& a5,
435 const ARG6& a6,
436 const ARG7& a7,
437 const ARG8& a8,
438 const ARG9& a9,
439 void *allocator);
440 template <class TARGET_TYPE,
441 class ARG1, class ARG2, class ARG3, class ARG4,
442 class ARG5, class ARG6, class ARG7, class ARG8,
443 class ARG9, class ARG10>
444 static void construct(TARGET_TYPE *address,
445 const ARG1& a1,
446 const ARG2& a2,
447 const ARG3& a3,
448 const ARG4& a4,
449 const ARG5& a5,
450 const ARG6& a6,
451 const ARG7& a7,
452 const ARG8& a8,
453 const ARG9& a9,
454 const ARG10& a10,
455 bslma::Allocator *allocator);
456 template <class TARGET_TYPE,
457 class ARG1, class ARG2, class ARG3, class ARG4,
458 class ARG5, class ARG6, class ARG7, class ARG8,
459 class ARG9, class ARG10>
460 static void construct(TARGET_TYPE *address,
461 const ARG1& a1,
462 const ARG2& a2,
463 const ARG3& a3,
464 const ARG4& a4,
465 const ARG5& a5,
466 const ARG6& a6,
467 const ARG7& a7,
468 const ARG8& a8,
469 const ARG9& a9,
470 const ARG10& a10,
471 void *allocator);
472 template <class TARGET_TYPE,
473 class ARG1, class ARG2, class ARG3, class ARG4,
474 class ARG5, class ARG6, class ARG7, class ARG8,
475 class ARG9, class ARG10, class ARG11>
476 static void construct(TARGET_TYPE *address,
477 const ARG1& a1,
478 const ARG2& a2,
479 const ARG3& a3,
480 const ARG4& a4,
481 const ARG5& a5,
482 const ARG6& a6,
483 const ARG7& a7,
484 const ARG8& a8,
485 const ARG9& a9,
486 const ARG10& a10,
487 const ARG11& a11,
488 bslma::Allocator *allocator);
489 template <class TARGET_TYPE,
490 class ARG1, class ARG2, class ARG3, class ARG4,
491 class ARG5, class ARG6, class ARG7, class ARG8,
492 class ARG9, class ARG10, class ARG11>
493 static void construct(TARGET_TYPE *address,
494 const ARG1& a1,
495 const ARG2& a2,
496 const ARG3& a3,
497 const ARG4& a4,
498 const ARG5& a5,
499 const ARG6& a6,
500 const ARG7& a7,
501 const ARG8& a8,
502 const ARG9& a9,
503 const ARG10& a10,
504 const ARG11& a11,
505 void *allocator);
506 template <class TARGET_TYPE,
507 class ARG1, class ARG2, class ARG3, class ARG4,
508 class ARG5, class ARG6, class ARG7, class ARG8,
509 class ARG9, class ARG10, class ARG11, class ARG12>
510 static void construct(TARGET_TYPE *address,
511 const ARG1& a1,
512 const ARG2& a2,
513 const ARG3& a3,
514 const ARG4& a4,
515 const ARG5& a5,
516 const ARG6& a6,
517 const ARG7& a7,
518 const ARG8& a8,
519 const ARG9& a9,
520 const ARG10& a10,
521 const ARG11& a11,
522 const ARG12& a12,
523 bslma::Allocator *allocator);
524 template <class TARGET_TYPE,
525 class ARG1, class ARG2, class ARG3, class ARG4,
526 class ARG5, class ARG6, class ARG7, class ARG8,
527 class ARG9, class ARG10, class ARG11, class ARG12>
528 static void construct(TARGET_TYPE *address,
529 const ARG1& a1,
530 const ARG2& a2,
531 const ARG3& a3,
532 const ARG4& a4,
533 const ARG5& a5,
534 const ARG6& a6,
535 const ARG7& a7,
536 const ARG8& a8,
537 const ARG9& a9,
538 const ARG10& a10,
539 const ARG11& a11,
540 const ARG12& a12,
541 void *allocator);
542 template <class TARGET_TYPE,
543 class ARG1, class ARG2, class ARG3, class ARG4,
544 class ARG5, class ARG6, class ARG7, class ARG8,
545 class ARG9, class ARG10, class ARG11, class ARG12,
546 class ARG13>
547 static void construct(TARGET_TYPE *address,
548 const ARG1& a1,
549 const ARG2& a2,
550 const ARG3& a3,
551 const ARG4& a4,
552 const ARG5& a5,
553 const ARG6& a6,
554 const ARG7& a7,
555 const ARG8& a8,
556 const ARG9& a9,
557 const ARG10& a10,
558 const ARG11& a11,
559 const ARG12& a12,
560 const ARG13& a13,
561 bslma::Allocator *allocator);
562 template <class TARGET_TYPE,
563 class ARG1, class ARG2, class ARG3, class ARG4,
564 class ARG5, class ARG6, class ARG7, class ARG8,
565 class ARG9, class ARG10, class ARG11, class ARG12,
566 class ARG13>
567 static void construct(TARGET_TYPE *address,
568 const ARG1& a1,
569 const ARG2& a2,
570 const ARG3& a3,
571 const ARG4& a4,
572 const ARG5& a5,
573 const ARG6& a6,
574 const ARG7& a7,
575 const ARG8& a8,
576 const ARG9& a9,
577 const ARG10& a10,
578 const ARG11& a11,
579 const ARG12& a12,
580 const ARG13& a13,
581 void *allocator);
582 template <class TARGET_TYPE,
583 class ARG1, class ARG2, class ARG3, class ARG4,
584 class ARG5, class ARG6, class ARG7, class ARG8,
585 class ARG9, class ARG10, class ARG11, class ARG12,
586 class ARG13, class ARG14>
587 static void construct(TARGET_TYPE *address,
588 const ARG1& a1,
589 const ARG2& a2,
590 const ARG3& a3,
591 const ARG4& a4,
592 const ARG5& a5,
593 const ARG6& a6,
594 const ARG7& a7,
595 const ARG8& a8,
596 const ARG9& a9,
597 const ARG10& a10,
598 const ARG11& a11,
599 const ARG12& a12,
600 const ARG13& a13,
601 const ARG14& a14,
602 bslma::Allocator *allocator);
603 template <class TARGET_TYPE,
604 class ARG1, class ARG2, class ARG3, class ARG4,
605 class ARG5, class ARG6, class ARG7, class ARG8,
606 class ARG9, class ARG10, class ARG11, class ARG12,
607 class ARG13, class ARG14>
608 static void construct(TARGET_TYPE *address,
609 const ARG1& a1,
610 const ARG2& a2,
611 const ARG3& a3,
612 const ARG4& a4,
613 const ARG5& a5,
614 const ARG6& a6,
615 const ARG7& a7,
616 const ARG8& a8,
617 const ARG9& a9,
618 const ARG10& a10,
619 const ARG11& a11,
620 const ARG12& a12,
621 const ARG13& a13,
622 const ARG14& a14,
623 void *allocator);
624
625#ifndef BDE_OMIT_INTERNAL_DEPRECATED
626 /// @deprecated Use @ref bslma::DestructionUtil::destroy without an
627 /// allocator argument instead.
628 ///
629 /// Destroy the specified `object` of the parameterized `TARGET_TYPE`,
630 /// as if by calling the `TARGET_TYPE` destructor, but do not deallocate
631 /// the memory occupied by `object`. Note that the destructor may
632 /// deallocate other memory owned by `object`. Also note that this
633 /// function is a no-op if the `TARGET_TYPE` has the trivial destructor
634 /// trait. Further note that the specified `allocator` is not used.
635 template <class TARGET_TYPE>
636 static void destruct(TARGET_TYPE *object,
637 void *allocator);
638
639 /// @deprecated Use @ref bslma::DestructionUtil::destroy instead.
640 ///
641 /// Destroy the specified `object` of the parameterized `TARGET_TYPE`,
642 /// as if by calling the `TARGET_TYPE` destructor, but do not deallocate
643 /// the memory occupied by `object`. Note that the destructor may
644 /// deallocate other memory owned by `object`. Also note that this
645 /// function is a no-op if the `TARGET_TYPE` has the trivial destructor
646 /// trait.
647 template <class TARGET_TYPE>
648 static void destruct(TARGET_TYPE *object);
649#endif // BDE_OMIT_INTERNAL_DEPRECATED
650
651 /// Swap the contents of the specified `lhs` of the parameterized
652 /// `LHS_TYPE` with those of the specified `rhs` of the parameterized
653 /// `RHS_TYPE`. Note that, if `LHS_TYPE` and `RHS_TYPE` are the same
654 /// type and that type has the bit-wise moveable trait but does not use
655 /// `bslma` allocators, the swap can be performed using a three-way
656 /// bit-wise move.
657 template <class LHS_TYPE, class RHS_TYPE>
658 static void swap(LHS_TYPE& lhs, RHS_TYPE& rhs);
659};
660
661 // ===========================
662 // struct ScalarPrimitives_Imp
663 // ===========================
664
665/// This `struct` provides a namespace for a suite of utility functions that
666/// operate on arrays of elements of a parameterized type `TARGET_TYPE`.
667/// These utility functions are only for the purpose of implementing those
668/// in the `ScalarPrimitives` utility, and should not be used outside this
669/// component.
671
672 enum {
673 // These constants are used in the overloads below, when the last
674 // argument is of type 'bsl::integral_constant<int, N> *', indicating
675 // that 'TARGET_TYPE' has the traits for which the enumerator equal to
676 // 'N' is named.
677
678 e_USES_ALLOCATOR_ARG_T_TRAITS = 5, // Implies USES_BSLMA_ALLOCATOR
683 e_NIL_TRAITS = 0
684 };
685
686 // CLASS METHODS
687
688 /// Return the `const`-unqualified value of the specified `pointer`.
689 /// This function resolves into a `const_cast` and therefore has no
690 /// runtime cost, it exists only for template argument deduction.
691 template <class TARGET_TYPE>
692 static TARGET_TYPE *unconst(const TARGET_TYPE *pointer);
693
694 /// Build a `TARGET_TYPE` object in a default state in the uninitialized
695 /// memory at the specified `address`, using the specified `allocator`
696 /// to supply memory if `TARGET_TYPE` uses `bslma` allocators. Use the
697 /// default constructor of the parameterized `TARGET_TYPE`, or `memset`
698 /// to 0 if `TARGET_TYPE` has a trivial default constructor. The last
699 /// argument is for traits overloading resolution only and its value is
700 /// ignored.
701 template <class TARGET_TYPE>
702 static void defaultConstruct(
703 TARGET_TYPE *address,
704 bslma::Allocator *allocator,
706 template <class TARGET_TYPE>
707 static void defaultConstruct(
708 TARGET_TYPE *address,
709 bslma::Allocator *allocator,
711 template <class TARGET_TYPE>
712 static void defaultConstruct(
713 TARGET_TYPE *address,
714 bslma::Allocator *allocator,
716 template <class TARGET_TYPE>
717 static void defaultConstruct(TARGET_TYPE *address,
718 bslma::Allocator *allocator,
720
721 /// Build a `TARGET_TYPE` object in a default state in the uninitialized
722 /// memory at the specified `address`. Use the default constructor of
723 /// the parameterized `TARGET_TYPE`, or `memset` to 0 if `TARGET_TYPE`
724 /// has a trivial default constructor. The last argument is for traits
725 /// overloading resolution only and its value is ignored.
726 template <class TARGET_TYPE>
727 static void defaultConstruct(
728 TARGET_TYPE *address,
730 template <class TARGET_TYPE>
731 static void defaultConstruct(TARGET_TYPE *address,
733
734 /// Build in the uninitialized memory at the specified `address` an
735 /// object of the parameterized `TARGET_TYPE` that is a copy of the
736 /// specified `original` object of the same `TARGET_TYPE`, using the
737 /// specified `allocator` to supply memory. Use the copy constructor of
738 /// the `TARGET_TYPE`, or a bit-wise copy if `TARGET_TYPE` is a bit-wise
739 /// copyable type. The last argument is for traits overloading
740 /// resolution only and its value is ignored. Note that a bit-wise copy
741 /// is appropriate only if `TARGET_TYPE` does not take allocators.
742 template <class TARGET_TYPE>
743 static void copyConstruct(
744 TARGET_TYPE *address,
745 const TARGET_TYPE& original,
746 bslma::Allocator *allocator,
748 template <class TARGET_TYPE>
749 static void copyConstruct(
750 TARGET_TYPE *address,
751 const TARGET_TYPE& original,
752 bslma::Allocator *allocator,
754 template <class TARGET_TYPE>
755 static void copyConstruct(
756 TARGET_TYPE *address,
757 const TARGET_TYPE& original,
758 bslma::Allocator *allocator,
760 template <class TARGET_TYPE>
761 static void copyConstruct(TARGET_TYPE *address,
762 const TARGET_TYPE& original,
763 bslma::Allocator *allocator,
765
766 /// Build in the uninitialized memory at the specified `address` an
767 /// object of the parameterized `TARGET_TYPE` that is a copy of the
768 /// specified `original` object of the same `TARGET_TYPE`. Use the copy
769 /// constructor of the `TARGET_TYPE`, or a bit-wise copy if
770 /// `TARGET_TYPE` is a bit-wise copyable type. The last argument is for
771 /// traits overloading resolution only and its value is ignored. Note
772 /// that a bit-wise copy is appropriate only if `TARGET_TYPE` does not
773 /// take allocators.
774 template <class TARGET_TYPE>
775 static void copyConstruct(
776 TARGET_TYPE *address,
777 const TARGET_TYPE& original,
779 template <class TARGET_TYPE>
780 static void copyConstruct(TARGET_TYPE *address,
781 const TARGET_TYPE& original,
783
784 /// Build in the uninitialized memory at the specified `address` an
785 /// object of the parameterized `TARGET_TYPE` that is a move of the
786 /// specified `original` object of the same `TARGET_TYPE`, using the
787 /// specified `allocator` to supply memory. Use the move constructor
788 /// of the `TARGET_TYPE`, or a bit-wise copy if `TARGET_TYPE` is a
789 /// bit-wise copyable type (not a bit-wise moveable type, which
790 /// indicates a destructive bit-wise move). The last argument is for
791 /// traits overloading resolution only and its value is ignored. Note
792 /// that a bit-wise copy is used only if `TARGET_TYPE` does not take
793 /// allocators. In C++03 mode, `moveConstruct` has the same effect as
794 /// `copyConstruct`.
795 template <class TARGET_TYPE>
796 static void moveConstruct(
797 TARGET_TYPE *address,
798 TARGET_TYPE& original,
799 bslma::Allocator *allocator,
801 template <class TARGET_TYPE>
802 static void moveConstruct(
803 TARGET_TYPE *address,
804 TARGET_TYPE& original,
805 bslma::Allocator *allocator,
807 template <class TARGET_TYPE>
808 static void moveConstruct(
809 TARGET_TYPE *address,
810 TARGET_TYPE& original,
811 bslma::Allocator *allocator,
813 template <class TARGET_TYPE>
814 static void moveConstruct(TARGET_TYPE *address,
815 TARGET_TYPE& original,
816 bslma::Allocator *allocator,
818
819 /// Build in the uninitialized memory at the specified `address` an
820 /// object of the parameterized `TARGET_TYPE` that is a move of the
821 /// specified `original` object of the same `TARGET_TYPE`. Use the move
822 /// constructor of the `TARGET_TYPE`, or a bit-wise copy if
823 /// `TARGET_TYPE` is a bit-wise copyable type (bit-wise copyable, NOT
824 /// bit-wise moveable, which relates to destructive bit-wise move). The
825 /// last argument is for traits overloading resolution only and its
826 /// value is ignored. In C++03 mode, `moveConstruct` has the same
827 /// effect as `copyConstruct`.
828 template <class TARGET_TYPE>
829 static void moveConstruct(
830 TARGET_TYPE *address,
831 TARGET_TYPE& original,
833 template <class TARGET_TYPE>
834 static void moveConstruct(TARGET_TYPE *address,
835 TARGET_TYPE& original,
837
838 /// Build a copy of the specified `original` in the uninitialized memory
839 /// at the specified `address`. Use the copy constructor of the
840 /// parameterized `TARGET_TYPE` (or a bit-wise copy if `TARGET_TYPE` is
841 /// bit-wise moveable). If `TARGET_TYPE` is not bit-wise moveable, also
842 /// destroy the `original`. The last argument is for traits overloading
843 /// resolution only and its value is ignored. Note that the specified
844 /// `allocator` is not used.
845 template <class TARGET_TYPE, class ALLOCATOR>
846 static void destructiveMove(
847 TARGET_TYPE *address,
848 TARGET_TYPE *original,
849 ALLOCATOR *allocator,
851 template <class TARGET_TYPE, class ALLOCATOR>
852 static void destructiveMove(TARGET_TYPE *address,
853 TARGET_TYPE *original,
854 ALLOCATOR *allocator,
856
857 /// Build an object from the specified `a1` in the uninitialized memory
858 /// at the specified `address`. The specified `allocator` is ignored.
859 /// Use the parameterized `TARGET_TYPE` constructor with the signature
860 /// `TARGET_TYPE(ARG1 const&)` or bitwise copy for non-fundamental
861 /// types. The traits argument is for overloading resolution only and
862 /// is ignored. Note that this function is called only when `ARG1` is
863 /// the same as `TARGET_TYPE`.
864 template <class TARGET_TYPE, class ARG1>
865 static void construct(
866 TARGET_TYPE *address,
867 const ARG1& a1,
868 bslma::Allocator *allocator,
870
871 /// Build an object of the parameterized `TARGET_TYPE` in the
872 /// uninitialized memory at the specified `address`, passing the
873 /// specified `a1` up to `a14` arguments of the corresponding
874 /// parameterized `ARG1` up to `ARG14` types to the `TARGET_TYPE`
875 /// constructor with the signature 'TARGET_TYPE(bsl::allocator_arg_t,
876 /// bslma::Allocator *, const ARG1&, ...)', and pass the specified
877 /// `allocator` as the second argument. The last argument is for
878 /// overloading resolution only and its value is ignored.
879 template <class TARGET_TYPE>
880 static void construct(
881 TARGET_TYPE *address,
882 bslma::Allocator *allocator,
884 template <class TARGET_TYPE, class ARG1>
885 static void construct(
886 TARGET_TYPE *address,
887 const ARG1& a1,
888 bslma::Allocator *allocator,
890 template <class TARGET_TYPE, class ARG1, class ARG2>
891 static void construct(
892 TARGET_TYPE *address,
893 const ARG1& a1,
894 const ARG2& a2,
895 bslma::Allocator *allocator,
897 template <class TARGET_TYPE,
898 class ARG1, class ARG2, class ARG3>
899 static void construct(
900 TARGET_TYPE *address,
901 const ARG1& a1,
902 const ARG2& a2,
903 const ARG3& a3,
904 bslma::Allocator *allocator,
906 template <class TARGET_TYPE,
907 class ARG1, class ARG2, class ARG3, class ARG4>
908 static void construct(
909 TARGET_TYPE *address,
910 const ARG1& a1,
911 const ARG2& a2,
912 const ARG3& a3,
913 const ARG4& a4,
914 bslma::Allocator *allocator,
916 template <class TARGET_TYPE,
917 class ARG1, class ARG2, class ARG3, class ARG4,
918 class ARG5>
919 static void construct(
920 TARGET_TYPE *address,
921 const ARG1& a1,
922 const ARG2& a2,
923 const ARG3& a3,
924 const ARG4& a4,
925 const ARG5& a5,
926 bslma::Allocator *allocator,
928 template <class TARGET_TYPE,
929 class ARG1, class ARG2, class ARG3, class ARG4,
930 class ARG5, class ARG6>
931 static void construct(
932 TARGET_TYPE *address,
933 const ARG1& a1,
934 const ARG2& a2,
935 const ARG3& a3,
936 const ARG4& a4,
937 const ARG5& a5,
938 const ARG6& a6,
939 bslma::Allocator *allocator,
941 template <class TARGET_TYPE,
942 class ARG1, class ARG2, class ARG3, class ARG4,
943 class ARG5, class ARG6, class ARG7>
944 static void construct(
945 TARGET_TYPE *address,
946 const ARG1& a1,
947 const ARG2& a2,
948 const ARG3& a3,
949 const ARG4& a4,
950 const ARG5& a5,
951 const ARG6& a6,
952 const ARG7& a7,
953 bslma::Allocator *allocator,
955 template <class TARGET_TYPE,
956 class ARG1, class ARG2, class ARG3, class ARG4,
957 class ARG5, class ARG6, class ARG7, class ARG8>
958 static void construct(
959 TARGET_TYPE *address,
960 const ARG1& a1,
961 const ARG2& a2,
962 const ARG3& a3,
963 const ARG4& a4,
964 const ARG5& a5,
965 const ARG6& a6,
966 const ARG7& a7,
967 const ARG8& a8,
968 bslma::Allocator *allocator,
970 template <class TARGET_TYPE,
971 class ARG1, class ARG2, class ARG3, class ARG4,
972 class ARG5, class ARG6, class ARG7, class ARG8,
973 class ARG9>
974 static void construct(
975 TARGET_TYPE *address,
976 const ARG1& a1,
977 const ARG2& a2,
978 const ARG3& a3,
979 const ARG4& a4,
980 const ARG5& a5,
981 const ARG6& a6,
982 const ARG7& a7,
983 const ARG8& a8,
984 const ARG9& a9,
985 bslma::Allocator *allocator,
987 template <class TARGET_TYPE,
988 class ARG1, class ARG2, class ARG3, class ARG4,
989 class ARG5, class ARG6, class ARG7, class ARG8,
990 class ARG9, class ARG10>
991 static void construct(
992 TARGET_TYPE *address,
993 const ARG1& a1,
994 const ARG2& a2,
995 const ARG3& a3,
996 const ARG4& a4,
997 const ARG5& a5,
998 const ARG6& a6,
999 const ARG7& a7,
1000 const ARG8& a8,
1001 const ARG9& a9,
1002 const ARG10& a10,
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, class ARG11>
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 const ARG11& a11,
1022 bslma::Allocator *allocator,
1024 template <class TARGET_TYPE,
1025 class ARG1, class ARG2, class ARG3, class ARG4,
1026 class ARG5, class ARG6, class ARG7, class ARG8,
1027 class ARG9, class ARG10, class ARG11, class ARG12>
1028 static void construct(
1029 TARGET_TYPE *address,
1030 const ARG1& a1,
1031 const ARG2& a2,
1032 const ARG3& a3,
1033 const ARG4& a4,
1034 const ARG5& a5,
1035 const ARG6& a6,
1036 const ARG7& a7,
1037 const ARG8& a8,
1038 const ARG9& a9,
1039 const ARG10& a10,
1040 const ARG11& a11,
1041 const ARG12& a12,
1042 bslma::Allocator *allocator,
1044 template <class TARGET_TYPE,
1045 class ARG1, class ARG2, class ARG3, class ARG4,
1046 class ARG5, class ARG6, class ARG7, class ARG8,
1047 class ARG9, class ARG10, class ARG11, class ARG12,
1048 class ARG13>
1049 static void construct(
1050 TARGET_TYPE *address,
1051 const ARG1& a1,
1052 const ARG2& a2,
1053 const ARG3& a3,
1054 const ARG4& a4,
1055 const ARG5& a5,
1056 const ARG6& a6,
1057 const ARG7& a7,
1058 const ARG8& a8,
1059 const ARG9& a9,
1060 const ARG10& a10,
1061 const ARG11& a11,
1062 const ARG12& a12,
1063 const ARG13& a13,
1064 bslma::Allocator *allocator,
1066 template <class TARGET_TYPE,
1067 class ARG1, class ARG2, class ARG3, class ARG4,
1068 class ARG5, class ARG6, class ARG7, class ARG8,
1069 class ARG9, class ARG10, class ARG11, class ARG12,
1070 class ARG13, class ARG14>
1071 static void construct(
1072 TARGET_TYPE *address,
1073 const ARG1& a1,
1074 const ARG2& a2,
1075 const ARG3& a3,
1076 const ARG4& a4,
1077 const ARG5& a5,
1078 const ARG6& a6,
1079 const ARG7& a7,
1080 const ARG8& a8,
1081 const ARG9& a9,
1082 const ARG10& a10,
1083 const ARG11& a11,
1084 const ARG12& a12,
1085 const ARG13& a13,
1086 const ARG14& a14,
1087 bslma::Allocator *allocator,
1089
1090 /// Build an object of the parameterized `TARGET_TYPE` in the
1091 /// uninitialized memory at the specified `address`, passing the
1092 /// specified `a1` up to `a14` arguments of the corresponding
1093 /// parameterized `ARG1` up to `ARG14` types to the `TARGET_TYPE`
1094 /// constructor with the signature
1095 /// `TARGET_TYPE(ARG1 const&, ..., bslma::Allocator *)`, and pass the
1096 /// specified `allocator` in the last position. The last argument is
1097 /// for overloading resolution only and its value is ignored.
1098 template <class TARGET_TYPE>
1099 static void construct(
1100 TARGET_TYPE *address,
1101 bslma::Allocator *allocator,
1103 template <class TARGET_TYPE, class ARG1>
1104 static void construct(
1105 TARGET_TYPE *address,
1106 const ARG1& a1,
1107 bslma::Allocator *allocator,
1109 template <class TARGET_TYPE, class ARG1, class ARG2>
1110 static void construct(
1111 TARGET_TYPE *address,
1112 const ARG1& a1,
1113 const ARG2& a2,
1114 bslma::Allocator *allocator,
1116 template <class TARGET_TYPE,
1117 class ARG1, class ARG2, class ARG3>
1118 static void construct(
1119 TARGET_TYPE *address,
1120 const ARG1& a1,
1121 const ARG2& a2,
1122 const ARG3& a3,
1123 bslma::Allocator *allocator,
1125 template <class TARGET_TYPE,
1126 class ARG1, class ARG2, class ARG3, class ARG4>
1127 static void construct(
1128 TARGET_TYPE *address,
1129 const ARG1& a1,
1130 const ARG2& a2,
1131 const ARG3& a3,
1132 const ARG4& a4,
1133 bslma::Allocator *allocator,
1135 template <class TARGET_TYPE,
1136 class ARG1, class ARG2, class ARG3, class ARG4,
1137 class ARG5>
1138 static void construct(
1139 TARGET_TYPE *address,
1140 const ARG1& a1,
1141 const ARG2& a2,
1142 const ARG3& a3,
1143 const ARG4& a4,
1144 const ARG5& a5,
1145 bslma::Allocator *allocator,
1147 template <class TARGET_TYPE,
1148 class ARG1, class ARG2, class ARG3, class ARG4,
1149 class ARG5, class ARG6>
1150 static void construct(
1151 TARGET_TYPE *address,
1152 const ARG1& a1,
1153 const ARG2& a2,
1154 const ARG3& a3,
1155 const ARG4& a4,
1156 const ARG5& a5,
1157 const ARG6& a6,
1158 bslma::Allocator *allocator,
1160 template <class TARGET_TYPE,
1161 class ARG1, class ARG2, class ARG3, class ARG4,
1162 class ARG5, class ARG6, class ARG7>
1163 static void construct(
1164 TARGET_TYPE *address,
1165 const ARG1& a1,
1166 const ARG2& a2,
1167 const ARG3& a3,
1168 const ARG4& a4,
1169 const ARG5& a5,
1170 const ARG6& a6,
1171 const ARG7& a7,
1172 bslma::Allocator *allocator,
1174 template <class TARGET_TYPE,
1175 class ARG1, class ARG2, class ARG3, class ARG4,
1176 class ARG5, class ARG6, class ARG7, class ARG8>
1177 static void construct(
1178 TARGET_TYPE *address,
1179 const ARG1& a1,
1180 const ARG2& a2,
1181 const ARG3& a3,
1182 const ARG4& a4,
1183 const ARG5& a5,
1184 const ARG6& a6,
1185 const ARG7& a7,
1186 const ARG8& a8,
1187 bslma::Allocator *allocator,
1189 template <class TARGET_TYPE,
1190 class ARG1, class ARG2, class ARG3, class ARG4,
1191 class ARG5, class ARG6, class ARG7, class ARG8,
1192 class ARG9>
1193 static void construct(
1194 TARGET_TYPE *address,
1195 const ARG1& a1,
1196 const ARG2& a2,
1197 const ARG3& a3,
1198 const ARG4& a4,
1199 const ARG5& a5,
1200 const ARG6& a6,
1201 const ARG7& a7,
1202 const ARG8& a8,
1203 const ARG9& a9,
1204 bslma::Allocator *allocator,
1206 template <class TARGET_TYPE,
1207 class ARG1, class ARG2, class ARG3, class ARG4,
1208 class ARG5, class ARG6, class ARG7, class ARG8,
1209 class ARG9, class ARG10>
1210 static void construct(
1211 TARGET_TYPE *address,
1212 const ARG1& a1,
1213 const ARG2& a2,
1214 const ARG3& a3,
1215 const ARG4& a4,
1216 const ARG5& a5,
1217 const ARG6& a6,
1218 const ARG7& a7,
1219 const ARG8& a8,
1220 const ARG9& a9,
1221 const ARG10& a10,
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, class ARG11>
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 const ARG11& a11,
1241 bslma::Allocator *allocator,
1243 template <class TARGET_TYPE,
1244 class ARG1, class ARG2, class ARG3, class ARG4,
1245 class ARG5, class ARG6, class ARG7, class ARG8,
1246 class ARG9, class ARG10, class ARG11, class ARG12>
1247 static void construct(
1248 TARGET_TYPE *address,
1249 const ARG1& a1,
1250 const ARG2& a2,
1251 const ARG3& a3,
1252 const ARG4& a4,
1253 const ARG5& a5,
1254 const ARG6& a6,
1255 const ARG7& a7,
1256 const ARG8& a8,
1257 const ARG9& a9,
1258 const ARG10& a10,
1259 const ARG11& a11,
1260 const ARG12& a12,
1261 bslma::Allocator *allocator,
1263 template <class TARGET_TYPE,
1264 class ARG1, class ARG2, class ARG3, class ARG4,
1265 class ARG5, class ARG6, class ARG7, class ARG8,
1266 class ARG9, class ARG10, class ARG11, class ARG12,
1267 class ARG13>
1268 static void construct(
1269 TARGET_TYPE *address,
1270 const ARG1& a1,
1271 const ARG2& a2,
1272 const ARG3& a3,
1273 const ARG4& a4,
1274 const ARG5& a5,
1275 const ARG6& a6,
1276 const ARG7& a7,
1277 const ARG8& a8,
1278 const ARG9& a9,
1279 const ARG10& a10,
1280 const ARG11& a11,
1281 const ARG12& a12,
1282 const ARG13& a13,
1283 bslma::Allocator *allocator,
1285 template <class TARGET_TYPE,
1286 class ARG1, class ARG2, class ARG3, class ARG4,
1287 class ARG5, class ARG6, class ARG7, class ARG8,
1288 class ARG9, class ARG10, class ARG11, class ARG12,
1289 class ARG13, class ARG14>
1290 static void construct(
1291 TARGET_TYPE *address,
1292 const ARG1& a1,
1293 const ARG2& a2,
1294 const ARG3& a3,
1295 const ARG4& a4,
1296 const ARG5& a5,
1297 const ARG6& a6,
1298 const ARG7& a7,
1299 const ARG8& a8,
1300 const ARG9& a9,
1301 const ARG10& a10,
1302 const ARG11& a11,
1303 const ARG12& a12,
1304 const ARG13& a13,
1305 const ARG14& a14,
1306 bslma::Allocator *allocator,
1308
1309 /// Build an object of the parameterized `TARGET_TYPE` in the
1310 /// uninitialized memory at the specified `address`, passing the
1311 /// specified `a1` up to `a14` arguments of the corresponding
1312 /// parameterized `ARG1` up to `ARG14` types to the `TARGET_TYPE`
1313 /// constructor with the signature `TARGET_TYPE(ARG1 const&, ...)`. The
1314 /// specified `allocator` is *not* passed through to the `TARGET_TYPE`
1315 /// constructor. The last argument is for overloading resolution only
1316 /// and is ignored.
1317 template <class TARGET_TYPE>
1318 static void construct(TARGET_TYPE *address,
1319 bslma::Allocator *allocator,
1321 template <class TARGET_TYPE, class ARG1>
1322 static void construct(TARGET_TYPE *address,
1323 const ARG1& a1,
1324 bslma::Allocator *allocator,
1326 template <class TARGET_TYPE, class ARG1, class ARG2>
1327 static void construct(TARGET_TYPE *address,
1328 const ARG1& a1,
1329 const ARG2& a2,
1330 bslma::Allocator *allocator,
1332 template <class TARGET_TYPE,
1333 class ARG1, class ARG2, class ARG3>
1334 static void construct(TARGET_TYPE *address,
1335 const ARG1& a1,
1336 const ARG2& a2,
1337 const ARG3& a3,
1338 bslma::Allocator *allocator,
1340 template <class TARGET_TYPE,
1341 class ARG1, class ARG2, class ARG3, class ARG4>
1342 static void construct(TARGET_TYPE *address,
1343 const ARG1& a1,
1344 const ARG2& a2,
1345 const ARG3& a3,
1346 const ARG4& a4,
1347 bslma::Allocator *allocator,
1349 template <class TARGET_TYPE,
1350 class ARG1, class ARG2, class ARG3, class ARG4,
1351 class ARG5>
1352 static void construct(TARGET_TYPE *address,
1353 const ARG1& a1,
1354 const ARG2& a2,
1355 const ARG3& a3,
1356 const ARG4& a4,
1357 const ARG5& a5,
1358 bslma::Allocator *allocator,
1360 template <class TARGET_TYPE,
1361 class ARG1, class ARG2, class ARG3, class ARG4,
1362 class ARG5, class ARG6>
1363 static void construct(TARGET_TYPE *address,
1364 const ARG1& a1,
1365 const ARG2& a2,
1366 const ARG3& a3,
1367 const ARG4& a4,
1368 const ARG5& a5,
1369 const ARG6& a6,
1370 bslma::Allocator *allocator,
1372 template <class TARGET_TYPE,
1373 class ARG1, class ARG2, class ARG3, class ARG4,
1374 class ARG5, class ARG6, class ARG7>
1375 static void construct(TARGET_TYPE *address,
1376 const ARG1& a1,
1377 const ARG2& a2,
1378 const ARG3& a3,
1379 const ARG4& a4,
1380 const ARG5& a5,
1381 const ARG6& a6,
1382 const ARG7& a7,
1383 bslma::Allocator *allocator,
1385 template <class TARGET_TYPE,
1386 class ARG1, class ARG2, class ARG3, class ARG4,
1387 class ARG5, class ARG6, class ARG7, class ARG8>
1388 static void construct(TARGET_TYPE *address,
1389 const ARG1& a1,
1390 const ARG2& a2,
1391 const ARG3& a3,
1392 const ARG4& a4,
1393 const ARG5& a5,
1394 const ARG6& a6,
1395 const ARG7& a7,
1396 const ARG8& a8,
1397 bslma::Allocator *allocator,
1399 template <class TARGET_TYPE,
1400 class ARG1, class ARG2, class ARG3, class ARG4,
1401 class ARG5, class ARG6, class ARG7, class ARG8,
1402 class ARG9>
1403 static void construct(TARGET_TYPE *address,
1404 const ARG1& a1,
1405 const ARG2& a2,
1406 const ARG3& a3,
1407 const ARG4& a4,
1408 const ARG5& a5,
1409 const ARG6& a6,
1410 const ARG7& a7,
1411 const ARG8& a8,
1412 const ARG9& a9,
1413 bslma::Allocator *allocator,
1415 template <class TARGET_TYPE,
1416 class ARG1, class ARG2, class ARG3, class ARG4,
1417 class ARG5, class ARG6, class ARG7, class ARG8,
1418 class ARG9, class ARG10>
1419 static void construct(TARGET_TYPE *address,
1420 const ARG1& a1,
1421 const ARG2& a2,
1422 const ARG3& a3,
1423 const ARG4& a4,
1424 const ARG5& a5,
1425 const ARG6& a6,
1426 const ARG7& a7,
1427 const ARG8& a8,
1428 const ARG9& a9,
1429 const ARG10& a10,
1430 bslma::Allocator *allocator,
1432 template <class TARGET_TYPE,
1433 class ARG1, class ARG2, class ARG3, class ARG4,
1434 class ARG5, class ARG6, class ARG7, class ARG8,
1435 class ARG9, class ARG10, class ARG11>
1436 static void construct(TARGET_TYPE *address,
1437 const ARG1& a1,
1438 const ARG2& a2,
1439 const ARG3& a3,
1440 const ARG4& a4,
1441 const ARG5& a5,
1442 const ARG6& a6,
1443 const ARG7& a7,
1444 const ARG8& a8,
1445 const ARG9& a9,
1446 const ARG10& a10,
1447 const ARG11& a11,
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, class ARG12>
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 const ARG12& a12,
1467 bslma::Allocator *allocator,
1469 template <class TARGET_TYPE,
1470 class ARG1, class ARG2, class ARG3, class ARG4,
1471 class ARG5, class ARG6, class ARG7, class ARG8,
1472 class ARG9, class ARG10, class ARG11, class ARG12,
1473 class ARG13>
1474 static void construct(TARGET_TYPE *address,
1475 const ARG1& a1,
1476 const ARG2& a2,
1477 const ARG3& a3,
1478 const ARG4& a4,
1479 const ARG5& a5,
1480 const ARG6& a6,
1481 const ARG7& a7,
1482 const ARG8& a8,
1483 const ARG9& a9,
1484 const ARG10& a10,
1485 const ARG11& a11,
1486 const ARG12& a12,
1487 const ARG13& a13,
1488 bslma::Allocator *allocator,
1490 template <class TARGET_TYPE,
1491 class ARG1, class ARG2, class ARG3, class ARG4,
1492 class ARG5, class ARG6, class ARG7, class ARG8,
1493 class ARG9, class ARG10, class ARG11, class ARG12,
1494 class ARG13, class ARG14>
1495 static void construct(TARGET_TYPE *address,
1496 const ARG1& a1,
1497 const ARG2& a2,
1498 const ARG3& a3,
1499 const ARG4& a4,
1500 const ARG5& a5,
1501 const ARG6& a6,
1502 const ARG7& a7,
1503 const ARG8& a8,
1504 const ARG9& a9,
1505 const ARG10& a10,
1506 const ARG11& a11,
1507 const ARG12& a12,
1508 const ARG13& a13,
1509 const ARG14& a14,
1510 bslma::Allocator *allocator,
1512
1513 /// Swap the contents of the specified `lhs` object of the parameterized
1514 /// `LHS_TYPE` with the specified `rhs` object of the parameterized
1515 /// `RHS_TYPE`. Use a three-way bit-wise copy (with a temporary
1516 /// uninitialized buffer), if `LHS_TYPE` and `RHS_TYPE` are the same
1517 /// bit-wise moveable type, and a three-way assignment with a temporary
1518 /// if not. The last argument is for overloading resolution only and is
1519 /// ignored.
1520 template <class LHS_TYPE, class RHS_TYPE>
1521 static void swap(LHS_TYPE& lhs,
1522 RHS_TYPE& rhs,
1524 template <class LHS_TYPE, class RHS_TYPE>
1525 static void swap(LHS_TYPE& lhs,
1526 RHS_TYPE& rhs,
1528};
1529
1530// ============================================================================
1531// TEMPLATE FUNCTION DEFINITIONS
1532// ============================================================================
1533
1534
1535// Workaround for optimization issue in xlC that mishandles pointer aliasing.
1536// IV56864: ALIASING BEHAVIOUR FOR PLACEMENT NEW
1537// http://www-01.ibm.com/support/docview.wss?uid=swg1IV56864
1538// Place this macro following each use of placement new. Alternatively,
1539// compile with xlC_r -qalias=noansi, which reduces optimization opportunities
1540// across entire translation unit instead of simply across optimization fence.
1541// Update: issue is fixed in xlC 13.1 (__xlC__ >= 0x0d01).
1542
1543#if defined(BSLS_PLATFORM_CMP_IBM) && BSLS_PLATFORM_CMP_VERSION < 0x0d01
1544 #define BSLALG_SCALARPRIMITIVES_XLC_PLACEMENT_NEW_FIX \
1545 BSLS_PERFORMANCEHINT_OPTIMIZATION_FENCE
1546#else
1547 #define BSLALG_SCALARPRIMITIVES_XLC_PLACEMENT_NEW_FIX
1548#endif
1549
1550 // -----------------------
1551 // struct ScalarPrimitives
1552 // -----------------------
1553
1554 // *** defaultConstruct overloads: ***
1555
1556template <class TARGET_TYPE>
1557inline
1558void
1577
1578template <class TARGET_TYPE>
1579inline
1580void
1593
1594 // *** copyConstruct overloads: ***
1595
1596template <class TARGET_TYPE>
1597inline
1598void
1617
1618template <class TARGET_TYPE>
1619inline
1620void
1622 const TARGET_TYPE& original,
1623 void *)
1624{
1625 BSLS_ASSERT_SAFE(address);
1626
1627 enum {
1631 };
1632 Imp::copyConstruct(address,
1633 original,
1635}
1636
1637 // *** moveConstruct overloads: ***
1638
1639template <class TARGET_TYPE>
1640inline
1641void
1660
1661template <class TARGET_TYPE>
1662inline
1663void
1665 TARGET_TYPE& original,
1666 void *)
1667{
1668 BSLS_ASSERT_SAFE(address);
1669
1670 enum {
1674 };
1675 Imp::moveConstruct(address, original,
1677}
1678
1679
1680 // *** destructiveMove overloads: ***
1681
1682template <class TARGET_TYPE, class ALLOCATOR>
1683inline
1684void
1686 TARGET_TYPE *original,
1687 ALLOCATOR *allocator)
1688{
1689 BSLS_ASSERT_SAFE(address);
1690 BSLS_ASSERT_SAFE(original);
1691
1692 enum {
1696 };
1697 Imp::destructiveMove(address,
1698 original,
1699 allocator,
1701}
1702
1703 // *** construct overloads: ****
1704
1705template <class TARGET_TYPE>
1706inline
1707void
1723
1724template <class TARGET_TYPE>
1725inline
1726void
1727ScalarPrimitives::construct(TARGET_TYPE *address,
1728 void *)
1729{
1730 BSLS_ASSERT_SAFE(address);
1731
1732 ::new (address) TARGET_TYPE();
1734}
1735
1736template <class TARGET_TYPE, class ARG1>
1737inline
1738void
1758
1759template <class TARGET_TYPE, class ARG1>
1760inline
1761void
1762ScalarPrimitives::construct(TARGET_TYPE *address,
1763 const ARG1& a1,
1764 void *)
1765{
1766 BSLS_ASSERT_SAFE(address);
1767
1768 ::new (address) TARGET_TYPE(a1);
1770}
1771
1772template <class TARGET_TYPE, class ARG1, class ARG2>
1773inline
1774void
1775ScalarPrimitives::construct(TARGET_TYPE *address,
1776 const ARG1& a1,
1777 const ARG2& a2,
1778 bslma::Allocator *allocator)
1779{
1780 BSLS_ASSERT_SAFE(address);
1781
1782 enum {
1788 };
1789 Imp::construct(address, a1, a2, allocator,
1791}
1792
1793template <class TARGET_TYPE, class ARG1, class ARG2>
1794inline
1795void
1796ScalarPrimitives::construct(TARGET_TYPE *address,
1797 const ARG1& a1,
1798 const ARG2& a2,
1799 void *)
1800{
1801 BSLS_ASSERT_SAFE(address);
1802
1803 ::new (address) TARGET_TYPE(a1, a2);
1805}
1806
1807template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
1808inline
1809void
1810ScalarPrimitives::construct(TARGET_TYPE *address,
1811 const ARG1& a1,
1812 const ARG2& a2,
1813 const ARG3& a3,
1814 bslma::Allocator *allocator)
1815{
1816 BSLS_ASSERT_SAFE(address);
1817
1818 enum {
1824 };
1825 Imp::construct(address,
1826 a1, a2, a3,
1827 allocator,
1829}
1830
1831template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
1832inline
1833void
1834ScalarPrimitives::construct(TARGET_TYPE *address,
1835 const ARG1& a1,
1836 const ARG2& a2,
1837 const ARG3& a3,
1838 void *)
1839{
1840 BSLS_ASSERT_SAFE(address);
1841
1842 ::new (address) TARGET_TYPE(a1, a2, a3);
1844}
1845
1846template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1847 class ARG4>
1848inline
1849void
1850ScalarPrimitives::construct(TARGET_TYPE *address,
1851 const ARG1& a1,
1852 const ARG2& a2,
1853 const ARG3& a3,
1854 const ARG4& a4,
1855 bslma::Allocator *allocator)
1856{
1857 BSLS_ASSERT_SAFE(address);
1858
1859 enum {
1865 };
1866 Imp::construct(address,
1867 a1, a2, a3, a4,
1868 allocator,
1870}
1871
1872template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1873 class ARG4>
1874inline
1875void
1876ScalarPrimitives::construct(TARGET_TYPE *address,
1877 const ARG1& a1,
1878 const ARG2& a2,
1879 const ARG3& a3,
1880 const ARG4& a4,
1881 void *)
1882{
1883 BSLS_ASSERT_SAFE(address);
1884
1885 ::new (address) TARGET_TYPE(a1, a2, a3, a4);
1887}
1888
1889template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1890 class ARG4, class ARG5>
1891inline
1892void
1893ScalarPrimitives::construct(TARGET_TYPE *address,
1894 const ARG1& a1,
1895 const ARG2& a2,
1896 const ARG3& a3,
1897 const ARG4& a4,
1898 const ARG5& a5,
1899 bslma::Allocator *allocator)
1900{
1901 BSLS_ASSERT_SAFE(address);
1902
1903 enum {
1909 };
1910 Imp::construct(address,
1911 a1, a2, a3, a4, a5,
1912 allocator,
1914}
1915
1916template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1917 class ARG4, class ARG5>
1918inline
1919void
1920ScalarPrimitives::construct(TARGET_TYPE *address,
1921 const ARG1& a1,
1922 const ARG2& a2,
1923 const ARG3& a3,
1924 const ARG4& a4,
1925 const ARG5& a5,
1926 void *)
1927{
1928 BSLS_ASSERT_SAFE(address);
1929
1930 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5);
1932}
1933
1934template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1935 class ARG4, class ARG5, class ARG6>
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 const ARG6& a6,
1945 bslma::Allocator *allocator)
1946{
1947 BSLS_ASSERT_SAFE(address);
1948
1949 enum {
1955 };
1956 Imp::construct(address,
1957 a1, a2, a3, a4, a5, a6,
1958 allocator,
1960}
1961
1962template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1963 class ARG4, class ARG5, class ARG6>
1964inline
1965void
1966ScalarPrimitives::construct(TARGET_TYPE *address,
1967 const ARG1& a1,
1968 const ARG2& a2,
1969 const ARG3& a3,
1970 const ARG4& a4,
1971 const ARG5& a5,
1972 const ARG6& a6,
1973 void *)
1974{
1975 BSLS_ASSERT_SAFE(address);
1976
1977 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6);
1979}
1980
1981template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
1982 class ARG4, class ARG5, class ARG6, class ARG7>
1983inline
1984void
1985ScalarPrimitives::construct(TARGET_TYPE *address,
1986 const ARG1& a1,
1987 const ARG2& a2,
1988 const ARG3& a3,
1989 const ARG4& a4,
1990 const ARG5& a5,
1991 const ARG6& a6,
1992 const ARG7& a7,
1993 bslma::Allocator *allocator)
1994{
1995 BSLS_ASSERT_SAFE(address);
1996
1997 enum {
2003 };
2004 Imp::construct(address,
2005 a1, a2, a3, a4, a5, a6, a7,
2006 allocator,
2008}
2009
2010template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2011 class ARG4, class ARG5, class ARG6, class ARG7>
2012inline
2013void
2014ScalarPrimitives::construct(TARGET_TYPE *address,
2015 const ARG1& a1,
2016 const ARG2& a2,
2017 const ARG3& a3,
2018 const ARG4& a4,
2019 const ARG5& a5,
2020 const ARG6& a6,
2021 const ARG7& a7,
2022 void *)
2023{
2024 BSLS_ASSERT_SAFE(address);
2025
2026 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7);
2028}
2029
2030template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2031 class ARG4, class ARG5, class ARG6, class ARG7,
2032 class ARG8>
2033inline
2034void
2035ScalarPrimitives::construct(TARGET_TYPE *address,
2036 const ARG1& a1,
2037 const ARG2& a2,
2038 const ARG3& a3,
2039 const ARG4& a4,
2040 const ARG5& a5,
2041 const ARG6& a6,
2042 const ARG7& a7,
2043 const ARG8& a8,
2044 bslma::Allocator *allocator)
2045{
2046 BSLS_ASSERT_SAFE(address);
2047
2048 enum {
2054 };
2055 Imp::construct(address,
2056 a1, a2, a3, a4, a5, a6, a7, a8,
2057 allocator,
2059}
2060
2061template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2062 class ARG4, class ARG5, class ARG6, class ARG7,
2063 class ARG8>
2064inline
2065void
2066ScalarPrimitives::construct(TARGET_TYPE *address,
2067 const ARG1& a1,
2068 const ARG2& a2,
2069 const ARG3& a3,
2070 const ARG4& a4,
2071 const ARG5& a5,
2072 const ARG6& a6,
2073 const ARG7& a7,
2074 const ARG8& a8,
2075 void *)
2076{
2077 BSLS_ASSERT_SAFE(address);
2078
2079 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8);
2081}
2082
2083template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2084 class ARG4, class ARG5, class ARG6, class ARG7,
2085 class ARG8, class ARG9>
2086inline
2087void
2088ScalarPrimitives::construct(TARGET_TYPE *address,
2089 const ARG1& a1,
2090 const ARG2& a2,
2091 const ARG3& a3,
2092 const ARG4& a4,
2093 const ARG5& a5,
2094 const ARG6& a6,
2095 const ARG7& a7,
2096 const ARG8& a8,
2097 const ARG9& a9,
2098 bslma::Allocator *allocator)
2099{
2100 BSLS_ASSERT_SAFE(address);
2101
2102 enum {
2108 };
2109 Imp::construct(address,
2110 a1, a2, a3, a4, a5, a6, a7, a8, a9,
2111 allocator,
2113}
2114
2115template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2116 class ARG4, class ARG5, class ARG6, class ARG7,
2117 class ARG8, class ARG9>
2118inline
2119void
2120ScalarPrimitives::construct(TARGET_TYPE *address,
2121 const ARG1& a1,
2122 const ARG2& a2,
2123 const ARG3& a3,
2124 const ARG4& a4,
2125 const ARG5& a5,
2126 const ARG6& a6,
2127 const ARG7& a7,
2128 const ARG8& a8,
2129 const ARG9& a9,
2130 void *)
2131{
2132 BSLS_ASSERT_SAFE(address);
2133
2134 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9);
2136}
2137
2138template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2139 class ARG4, class ARG5, class ARG6, class ARG7,
2140 class ARG8, class ARG9, class ARG10>
2141inline
2142void
2143ScalarPrimitives::construct(TARGET_TYPE *address,
2144 const ARG1& a1,
2145 const ARG2& a2,
2146 const ARG3& a3,
2147 const ARG4& a4,
2148 const ARG5& a5,
2149 const ARG6& a6,
2150 const ARG7& a7,
2151 const ARG8& a8,
2152 const ARG9& a9,
2153 const ARG10& a10,
2154 bslma::Allocator *allocator)
2155{
2156 BSLS_ASSERT_SAFE(address);
2157
2158 enum {
2164 };
2165 Imp::construct(address,
2166 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
2167 allocator,
2169}
2170
2171template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2172 class ARG4, class ARG5, class ARG6, class ARG7,
2173 class ARG8, class ARG9, class ARG10>
2174inline
2175void
2176ScalarPrimitives::construct(TARGET_TYPE *address,
2177 const ARG1& a1,
2178 const ARG2& a2,
2179 const ARG3& a3,
2180 const ARG4& a4,
2181 const ARG5& a5,
2182 const ARG6& a6,
2183 const ARG7& a7,
2184 const ARG8& a8,
2185 const ARG9& a9,
2186 const ARG10& a10,
2187 void *)
2188{
2189 BSLS_ASSERT_SAFE(address);
2190
2191 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
2193}
2194
2195template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2196 class ARG4, class ARG5, class ARG6, class ARG7,
2197 class ARG8, class ARG9, class ARG10, class ARG11>
2198inline
2199void
2200ScalarPrimitives::construct(TARGET_TYPE *address,
2201 const ARG1& a1,
2202 const ARG2& a2,
2203 const ARG3& a3,
2204 const ARG4& a4,
2205 const ARG5& a5,
2206 const ARG6& a6,
2207 const ARG7& a7,
2208 const ARG8& a8,
2209 const ARG9& a9,
2210 const ARG10& a10,
2211 const ARG11& a11,
2212 bslma::Allocator *allocator)
2213{
2214 BSLS_ASSERT_SAFE(address);
2215
2216 enum {
2222 };
2223 Imp::construct(address,
2224 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11,
2225 allocator,
2227}
2228
2229template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2230 class ARG4, class ARG5, class ARG6, class ARG7,
2231 class ARG8, class ARG9, class ARG10, class ARG11>
2232inline
2233void
2234ScalarPrimitives::construct(TARGET_TYPE *address,
2235 const ARG1& a1,
2236 const ARG2& a2,
2237 const ARG3& a3,
2238 const ARG4& a4,
2239 const ARG5& a5,
2240 const ARG6& a6,
2241 const ARG7& a7,
2242 const ARG8& a8,
2243 const ARG9& a9,
2244 const ARG10& a10,
2245 const ARG11& a11,
2246 void *)
2247{
2248 BSLS_ASSERT_SAFE(address);
2249
2250 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
2252}
2253
2254template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2255 class ARG4, class ARG5, class ARG6, class ARG7,
2256 class ARG8, class ARG9, class ARG10, class ARG11,
2257 class ARG12>
2258inline
2259void
2260ScalarPrimitives::construct(TARGET_TYPE *address,
2261 const ARG1& a1,
2262 const ARG2& a2,
2263 const ARG3& a3,
2264 const ARG4& a4,
2265 const ARG5& a5,
2266 const ARG6& a6,
2267 const ARG7& a7,
2268 const ARG8& a8,
2269 const ARG9& a9,
2270 const ARG10& a10,
2271 const ARG11& a11,
2272 const ARG12& a12,
2273 bslma::Allocator *allocator)
2274{
2275 BSLS_ASSERT_SAFE(address);
2276
2277 enum {
2283 };
2284 Imp::construct(address,
2285 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12,
2286 allocator,
2288}
2289
2290template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2291 class ARG4, class ARG5, class ARG6, class ARG7,
2292 class ARG8, class ARG9, class ARG10, class ARG11,
2293 class ARG12>
2294inline
2295void
2296ScalarPrimitives::construct(TARGET_TYPE *address,
2297 const ARG1& a1,
2298 const ARG2& a2,
2299 const ARG3& a3,
2300 const ARG4& a4,
2301 const ARG5& a5,
2302 const ARG6& a6,
2303 const ARG7& a7,
2304 const ARG8& a8,
2305 const ARG9& a9,
2306 const ARG10& a10,
2307 const ARG11& a11,
2308 const ARG12& a12,
2309 void *)
2310{
2311 BSLS_ASSERT_SAFE(address);
2312
2313 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9,
2314 a10, a11, a12);
2316}
2317
2318template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2319 class ARG4, class ARG5, class ARG6, class ARG7,
2320 class ARG8, class ARG9, class ARG10, class ARG11,
2321 class ARG12, class ARG13>
2322inline
2323void
2324ScalarPrimitives::construct(TARGET_TYPE *address,
2325 const ARG1& a1,
2326 const ARG2& a2,
2327 const ARG3& a3,
2328 const ARG4& a4,
2329 const ARG5& a5,
2330 const ARG6& a6,
2331 const ARG7& a7,
2332 const ARG8& a8,
2333 const ARG9& a9,
2334 const ARG10& a10,
2335 const ARG11& a11,
2336 const ARG12& a12,
2337 const ARG13& a13,
2338 bslma::Allocator *allocator)
2339{
2340 BSLS_ASSERT_SAFE(address);
2341
2342 enum {
2348 };
2349 Imp::construct(address,
2350 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13,
2351 allocator,
2353}
2354
2355template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2356 class ARG4, class ARG5, class ARG6, class ARG7,
2357 class ARG8, class ARG9, class ARG10, class ARG11,
2358 class ARG12, class ARG13>
2359inline
2360void
2361ScalarPrimitives::construct(TARGET_TYPE *address,
2362 const ARG1& a1,
2363 const ARG2& a2,
2364 const ARG3& a3,
2365 const ARG4& a4,
2366 const ARG5& a5,
2367 const ARG6& a6,
2368 const ARG7& a7,
2369 const ARG8& a8,
2370 const ARG9& a9,
2371 const ARG10& a10,
2372 const ARG11& a11,
2373 const ARG12& a12,
2374 const ARG13& a13,
2375 void *)
2376{
2377 BSLS_ASSERT_SAFE(address);
2378
2379 ::new (address) TARGET_TYPE(
2380 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
2382}
2383
2384template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2385 class ARG4, class ARG5, class ARG6, class ARG7,
2386 class ARG8, class ARG9, class ARG10, class ARG11,
2387 class ARG12, class ARG13, class ARG14>
2388inline
2389void
2390ScalarPrimitives::construct(TARGET_TYPE *address,
2391 const ARG1& a1,
2392 const ARG2& a2,
2393 const ARG3& a3,
2394 const ARG4& a4,
2395 const ARG5& a5,
2396 const ARG6& a6,
2397 const ARG7& a7,
2398 const ARG8& a8,
2399 const ARG9& a9,
2400 const ARG10& a10,
2401 const ARG11& a11,
2402 const ARG12& a12,
2403 const ARG13& a13,
2404 const ARG14& a14,
2405 bslma::Allocator *allocator)
2406{
2407 BSLS_ASSERT_SAFE(address);
2408
2409 enum {
2415 };
2416 Imp::construct(address,
2417 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
2418 allocator,
2420}
2421
2422template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
2423 class ARG4, class ARG5, class ARG6, class ARG7,
2424 class ARG8, class ARG9, class ARG10, class ARG11,
2425 class ARG12, class ARG13, class ARG14>
2426inline
2427void
2428ScalarPrimitives::construct(TARGET_TYPE *address,
2429 const ARG1& a1,
2430 const ARG2& a2,
2431 const ARG3& a3,
2432 const ARG4& a4,
2433 const ARG5& a5,
2434 const ARG6& a6,
2435 const ARG7& a7,
2436 const ARG8& a8,
2437 const ARG9& a9,
2438 const ARG10& a10,
2439 const ARG11& a11,
2440 const ARG12& a12,
2441 const ARG13& a13,
2442 const ARG14& a14,
2443 void *)
2444{
2445 BSLS_ASSERT_SAFE(address);
2446
2447 ::new (address) TARGET_TYPE(
2448 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
2450}
2451
2452} // close package namespace
2453
2454 // *** destruct overloads: ***
2455
2456#ifndef BDE_OMIT_INTERNAL_DEPRECATED
2457
2458namespace bslalg {
2459
2460template <class TARGET_TYPE>
2461inline
2462void ScalarPrimitives::destruct(TARGET_TYPE *address, void *)
2463{
2464 bslma::DestructionUtil::destroy(address);
2465}
2466
2467template <class TARGET_TYPE>
2468inline
2469void ScalarPrimitives::destruct(TARGET_TYPE *address)
2470{
2471 bslma::DestructionUtil::destroy(address);
2472}
2473
2474} // close package namespace
2475
2476#endif // BDE_OMIT_INTERNAL_DEPRECATED
2477
2478namespace bslalg {
2479
2480 // *** swap overloads: ***
2481
2482template <class LHS_TYPE, class RHS_TYPE>
2493
2494 // ---------------------------
2495 // struct ScalarPrimitives_Imp
2496 // ---------------------------
2497
2498// CLASS METHODS
2499template <class TARGET_TYPE>
2500inline
2501TARGET_TYPE *ScalarPrimitives_Imp::unconst(const TARGET_TYPE *pointer)
2502{
2503 return const_cast<TARGET_TYPE *>(pointer);
2504}
2505
2506 // *** defaultConstruct overloads: ***
2507
2508template <class TARGET_TYPE>
2509inline
2510void
2512 TARGET_TYPE *address,
2513 bslma::Allocator *allocator,
2515{
2516 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator);
2518}
2519
2520template <class TARGET_TYPE>
2521inline
2522void
2524 TARGET_TYPE *address,
2525 bslma::Allocator *allocator,
2527{
2528 ::new (address) TARGET_TYPE(allocator);
2530}
2531
2532template <class TARGET_TYPE>
2533inline
2534void
2544
2545template <class TARGET_TYPE>
2546inline
2547void
2549 TARGET_TYPE *address,
2552{
2553 ::new (address) TARGET_TYPE();
2555}
2556
2557template <class TARGET_TYPE>
2558inline
2559void
2561 TARGET_TYPE *address,
2563{
2566 // Detectable at compile-time, this condition ensures that we don't
2567 // call library functions for fundamental or pointer types. Note that
2568 // assignment can't throw.
2569
2570 ::new (address) TARGET_TYPE();
2572 } else {
2573 memset(reinterpret_cast<char *>(address), 0, sizeof *address);
2574 }
2575}
2576
2577template <class TARGET_TYPE>
2578inline
2579void
2581 TARGET_TYPE *address,
2583{
2584 ::new (address) TARGET_TYPE();
2586}
2587
2588 // *** copyConstruct overloads: ***
2589
2590template <class TARGET_TYPE>
2591inline
2592void
2594 TARGET_TYPE *address,
2595 const TARGET_TYPE& original,
2596 bslma::Allocator *allocator,
2598{
2599 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, original);
2601}
2602
2603template <class TARGET_TYPE>
2604inline
2605void
2607 TARGET_TYPE *address,
2608 const TARGET_TYPE& original,
2609 bslma::Allocator *allocator,
2611{
2612 ::new (address) TARGET_TYPE(original, allocator);
2614}
2615
2616template <class TARGET_TYPE>
2617inline
2618void
2620 TARGET_TYPE *address,
2621 const TARGET_TYPE& original,
2624{
2627 // Detectable at compile-time, this condition ensures that we don't
2628 // call library functions for fundamental or pointer types. Note that
2629 // copy-constructor can't throw, and that assignment (although would
2630 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2631 // is 'const'-qualified.
2632
2633 ::new (address) TARGET_TYPE(original);
2635 } else {
2636#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2637#pragma GCC diagnostic push
2638#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2639#endif
2640 memcpy((void *)address,
2641 BSLS_UTIL_ADDRESSOF(original),
2642 sizeof original);
2643#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2644#pragma GCC diagnostic pop
2645#endif
2646 }
2647}
2648
2649template <class TARGET_TYPE>
2650inline
2651void
2653 TARGET_TYPE *address,
2654 const TARGET_TYPE& original,
2657{
2658 ::new (address) TARGET_TYPE(original);
2660}
2661
2662template <class TARGET_TYPE>
2663inline
2664void
2666 TARGET_TYPE *address,
2667 const TARGET_TYPE& original,
2669{
2672 // Detectable at compile-time, this condition ensures that we don't
2673 // call library functions for fundamental or pointer types. Note that
2674 // copy-constructor can't throw, and that assignment (although would
2675 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2676 // is 'const'-qualified.
2677
2678 ::new (address) TARGET_TYPE(original);
2680 } else {
2681#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2682#pragma GCC diagnostic push
2683#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2684#endif
2685 memcpy((void *)address,
2686 BSLS_UTIL_ADDRESSOF(original),
2687 sizeof original);
2688#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2689#pragma GCC diagnostic pop
2690#endif
2691 }
2692}
2693
2694template <class TARGET_TYPE>
2695inline
2696void
2698 TARGET_TYPE *address,
2699 const TARGET_TYPE& original,
2701{
2702 ::new (address) TARGET_TYPE(original);
2704}
2705
2706 // *** moveConstruct overloads: ***
2707
2708template <class TARGET_TYPE>
2709inline
2710void
2712 TARGET_TYPE *address,
2713 TARGET_TYPE& original,
2714 bslma::Allocator *allocator,
2716{
2717 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator,
2718 bslmf::MovableRefUtil::move(original));
2719}
2720
2721template <class TARGET_TYPE>
2722inline
2723void
2725 TARGET_TYPE *address,
2726 TARGET_TYPE& original,
2727 bslma::Allocator *allocator,
2729{
2730 ::new (address) TARGET_TYPE(bslmf::MovableRefUtil::move(original),
2731 allocator);
2732}
2733
2734template <class TARGET_TYPE>
2735inline
2736void
2738 TARGET_TYPE *address,
2739 TARGET_TYPE& original,
2742{
2745 // Detectable at compile-time, this condition ensures that we don't
2746 // call library functions for fundamental or pointer types. Note that
2747 // copy-constructor can't throw, and that assignment (although would
2748 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2749 // is 'const'-qualified.
2750
2751 ::new (address) TARGET_TYPE(original);
2752 } else {
2753#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2754#pragma GCC diagnostic push
2755#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2756#endif
2757 memcpy(address, BSLS_UTIL_ADDRESSOF(original), sizeof original);
2758#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2759#pragma GCC diagnostic pop
2760#endif
2761 }
2762}
2763
2764template <class TARGET_TYPE>
2765inline
2766void
2768 TARGET_TYPE *address,
2769 TARGET_TYPE& original,
2772{
2773 ::new (address) TARGET_TYPE(bslmf::MovableRefUtil::move(original));
2774}
2775
2776template <class TARGET_TYPE>
2777inline
2778void
2780 TARGET_TYPE *address,
2781 TARGET_TYPE& original,
2783{
2786 // Detectable at compile-time, this condition ensures that we don't
2787 // call library functions for fundamental or pointer types. Note that
2788 // move-constructor can't throw, and that assignment (although would
2789 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2790 // is 'const'-qualified.
2791
2792 ::new (address) TARGET_TYPE(original);
2793 } else {
2794#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2795#pragma GCC diagnostic push
2796#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2797#endif
2798 memcpy((void *)address,
2799 BSLS_UTIL_ADDRESSOF(original),
2800 sizeof original);
2801#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2802#pragma GCC diagnostic pop
2803#endif
2804 }
2805}
2806
2807template <class TARGET_TYPE>
2808inline
2809void
2811 TARGET_TYPE *address,
2812 TARGET_TYPE& original,
2814{
2815 ::new (address) TARGET_TYPE(bslmf::MovableRefUtil::move(original));
2816}
2817
2818 // *** destructiveMove overloads: ***
2819
2820template <class TARGET_TYPE, class ALLOCATOR>
2821inline
2822void
2824 TARGET_TYPE *address,
2825 TARGET_TYPE *original,
2826 ALLOCATOR *,
2828{
2831 // Detectable at compile-time, this condition ensures that we don't
2832 // call library functions for fundamental or pointer types. Note that
2833 // copy-constructor can't throw, and that assignment (although would
2834 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2835 // is 'const'-qualified.
2836
2837 ::new (address) TARGET_TYPE(*original);
2839 } else {
2840#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2841#pragma GCC diagnostic push
2842#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
2843#endif
2844 memcpy((void *)address, original, sizeof *original); // no overlap
2845#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 50000
2846#pragma GCC diagnostic pop
2847#endif
2848 }
2849}
2850
2851template <class TARGET_TYPE, class ALLOCATOR>
2852inline
2853void
2855 TARGET_TYPE *address,
2856 TARGET_TYPE *original,
2857 ALLOCATOR *allocator,
2859{
2860 ScalarPrimitives::moveConstruct(address, *original, allocator);
2861 bslma::DestructionUtil::destroy(original);
2862}
2863
2864 // *** construct overloads: ***
2865
2866template <class TARGET_TYPE, class ARG1>
2867inline
2868void
2870 TARGET_TYPE *address,
2871 const ARG1& a1,
2874{
2877 // Detectable at compile-time, this condition ensures that we don't
2878 // call library functions for fundamental or pointer types. Note that
2879 // copy-constructor can't throw, and that assignment (although would
2880 // likely produce equivalent code) can't be used, in case 'TARGET_TYPE'
2881 // is 'const'-qualified.
2882
2883 ::new (address) TARGET_TYPE(a1);
2885 } else {
2886 BSLMF_ASSERT(sizeof (TARGET_TYPE) == sizeof(a1));
2887 memcpy((void *)address, BSLS_UTIL_ADDRESSOF(a1), sizeof a1);
2888 // no overlap
2889 }
2890}
2891
2892template <class TARGET_TYPE>
2893inline
2894void
2896 TARGET_TYPE *address,
2897 bslma::Allocator *allocator,
2899{
2900 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator);
2902}
2903
2904template <class TARGET_TYPE>
2905inline
2906void
2908 TARGET_TYPE *address,
2909 bslma::Allocator *allocator,
2911{
2912 ::new (address) TARGET_TYPE(allocator);
2914}
2915
2916template <class TARGET_TYPE>
2917inline
2918void
2922{
2923 ::new (address) TARGET_TYPE();
2925}
2926
2927template <class TARGET_TYPE, class ARG1>
2928inline
2929void
2931 TARGET_TYPE *address,
2932 const ARG1& a1,
2933 bslma::Allocator *allocator,
2935{
2936 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1);
2938}
2939
2940template <class TARGET_TYPE, class ARG1>
2941inline
2942void
2944 TARGET_TYPE *address,
2945 const ARG1& a1,
2946 bslma::Allocator *allocator,
2948{
2949 ::new (address) TARGET_TYPE(a1, allocator);
2951}
2952
2953template <class TARGET_TYPE, class ARG1>
2954inline
2955void
2957 const ARG1& a1,
2960{
2961 ::new (address) TARGET_TYPE(a1);
2963}
2964
2965template <class TARGET_TYPE, class ARG1, class ARG2>
2966inline
2967void
2969 TARGET_TYPE *address,
2970 const ARG1& a1,
2971 const ARG2& a2,
2972 bslma::Allocator *allocator,
2974{
2975 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2);
2977}
2978
2979template <class TARGET_TYPE, class ARG1, class ARG2>
2980inline
2981void
2983 TARGET_TYPE *address,
2984 const ARG1& a1,
2985 const ARG2& a2,
2986 bslma::Allocator *allocator,
2988{
2989 ::new (address) TARGET_TYPE(a1, a2, allocator);
2991}
2992
2993template <class TARGET_TYPE, class ARG1, class ARG2>
2994inline
2995void
2997 const ARG1& a1,
2998 const ARG2& a2,
3001{
3002 ::new (address) TARGET_TYPE(a1, a2);
3004}
3005
3006template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
3007inline
3008void
3010 TARGET_TYPE *address,
3011 const ARG1& a1,
3012 const ARG2& a2,
3013 const ARG3& a3,
3014 bslma::Allocator *allocator,
3016{
3017 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3);
3019}
3020
3021template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
3022inline
3023void
3025 TARGET_TYPE *address,
3026 const ARG1& a1,
3027 const ARG2& a2,
3028 const ARG3& a3,
3029 bslma::Allocator *allocator,
3031{
3032 ::new (address) TARGET_TYPE(a1, a2, a3, allocator);
3034}
3035
3036template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3>
3037inline
3038void
3040 const ARG1& a1,
3041 const ARG2& a2,
3042 const ARG3& a3,
3045{
3046 ::new (address) TARGET_TYPE(a1, a2, a3);
3048}
3049
3050template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3051 class ARG4>
3052inline
3053void
3055 TARGET_TYPE *address,
3056 const ARG1& a1,
3057 const ARG2& a2,
3058 const ARG3& a3,
3059 const ARG4& a4,
3060 bslma::Allocator *allocator,
3062{
3063 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4);
3065}
3066
3067template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3068 class ARG4>
3069inline
3070void
3072 TARGET_TYPE *address,
3073 const ARG1& a1,
3074 const ARG2& a2,
3075 const ARG3& a3,
3076 const ARG4& a4,
3077 bslma::Allocator *allocator,
3079{
3080 ::new (address) TARGET_TYPE(a1, a2, a3, a4, allocator);
3082}
3083
3084template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3085 class ARG4>
3086inline
3087void
3089 const ARG1& a1,
3090 const ARG2& a2,
3091 const ARG3& a3,
3092 const ARG4& a4,
3095{
3096 ::new (address) TARGET_TYPE(a1, a2, a3, a4);
3098}
3099
3100template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3101 class ARG4, class ARG5>
3102inline
3103void
3105 TARGET_TYPE *address,
3106 const ARG1& a1,
3107 const ARG2& a2,
3108 const ARG3& a3,
3109 const ARG4& a4,
3110 const ARG5& a5,
3111 bslma::Allocator *allocator,
3113{
3114 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3115 a5);
3117}
3118
3119template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3120 class ARG4, class ARG5>
3121inline
3122void
3124 TARGET_TYPE *address,
3125 const ARG1& a1,
3126 const ARG2& a2,
3127 const ARG3& a3,
3128 const ARG4& a4,
3129 const ARG5& a5,
3130 bslma::Allocator *allocator,
3132{
3133 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, allocator);
3135}
3136
3137template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3138 class ARG4, class ARG5>
3139inline
3140void
3142 const ARG1& a1,
3143 const ARG2& a2,
3144 const ARG3& a3,
3145 const ARG4& a4,
3146 const ARG5& a5,
3149{
3150 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5);
3152}
3153
3154template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3155 class ARG4, class ARG5, class ARG6>
3156inline
3157void
3159 TARGET_TYPE *address,
3160 const ARG1& a1,
3161 const ARG2& a2,
3162 const ARG3& a3,
3163 const ARG4& a4,
3164 const ARG5& a5,
3165 const ARG6& a6,
3166 bslma::Allocator *allocator,
3168{
3169 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3170 a5, a6);
3172}
3173
3174template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3175 class ARG4, class ARG5, class ARG6>
3176inline
3177void
3179 TARGET_TYPE *address,
3180 const ARG1& a1,
3181 const ARG2& a2,
3182 const ARG3& a3,
3183 const ARG4& a4,
3184 const ARG5& a5,
3185 const ARG6& a6,
3186 bslma::Allocator *allocator,
3188{
3189 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, allocator);
3191}
3192
3193template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3194 class ARG4, class ARG5, class ARG6>
3195inline
3196void
3198 const ARG1& a1,
3199 const ARG2& a2,
3200 const ARG3& a3,
3201 const ARG4& a4,
3202 const ARG5& a5,
3203 const ARG6& a6,
3206{
3207 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6);
3209}
3210
3211template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3212 class ARG4, class ARG5, class ARG6, class ARG7>
3213inline
3214void
3216 TARGET_TYPE *address,
3217 const ARG1& a1,
3218 const ARG2& a2,
3219 const ARG3& a3,
3220 const ARG4& a4,
3221 const ARG5& a5,
3222 const ARG6& a6,
3223 const ARG7& a7,
3224 bslma::Allocator *allocator,
3226{
3227 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3228 a5, a6, a7);
3230}
3231
3232template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3233 class ARG4, class ARG5, class ARG6, class ARG7>
3234inline
3235void
3237 TARGET_TYPE *address,
3238 const ARG1& a1,
3239 const ARG2& a2,
3240 const ARG3& a3,
3241 const ARG4& a4,
3242 const ARG5& a5,
3243 const ARG6& a6,
3244 const ARG7& a7,
3245 bslma::Allocator *allocator,
3247{
3248 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, allocator);
3250}
3251
3252template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3253 class ARG4, class ARG5, class ARG6, class ARG7>
3254inline
3255void
3257 const ARG1& a1,
3258 const ARG2& a2,
3259 const ARG3& a3,
3260 const ARG4& a4,
3261 const ARG5& a5,
3262 const ARG6& a6,
3263 const ARG7& a7,
3266{
3267 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7);
3269}
3270
3271template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3272 class ARG4, class ARG5, class ARG6, class ARG7,
3273 class ARG8>
3274inline
3275void
3277 TARGET_TYPE *address,
3278 const ARG1& a1,
3279 const ARG2& a2,
3280 const ARG3& a3,
3281 const ARG4& a4,
3282 const ARG5& a5,
3283 const ARG6& a6,
3284 const ARG7& a7,
3285 const ARG8& a8,
3286 bslma::Allocator *allocator,
3288{
3289 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3290 a5, a6, a7, a8);
3292}
3293
3294template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3295 class ARG4, class ARG5, class ARG6, class ARG7,
3296 class ARG8>
3297inline
3298void
3300 TARGET_TYPE *address,
3301 const ARG1& a1,
3302 const ARG2& a2,
3303 const ARG3& a3,
3304 const ARG4& a4,
3305 const ARG5& a5,
3306 const ARG6& a6,
3307 const ARG7& a7,
3308 const ARG8& a8,
3309 bslma::Allocator *allocator,
3311{
3312 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, allocator);
3314}
3315
3316template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3317 class ARG4, class ARG5, class ARG6, class ARG7,
3318 class ARG8>
3319inline
3320void
3322 const ARG1& a1,
3323 const ARG2& a2,
3324 const ARG3& a3,
3325 const ARG4& a4,
3326 const ARG5& a5,
3327 const ARG6& a6,
3328 const ARG7& a7,
3329 const ARG8& a8,
3332{
3333 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8);
3335}
3336
3337template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3338 class ARG4, class ARG5, class ARG6, class ARG7,
3339 class ARG8, class ARG9>
3340inline
3341void
3343 TARGET_TYPE *address,
3344 const ARG1& a1,
3345 const ARG2& a2,
3346 const ARG3& a3,
3347 const ARG4& a4,
3348 const ARG5& a5,
3349 const ARG6& a6,
3350 const ARG7& a7,
3351 const ARG8& a8,
3352 const ARG9& a9,
3353 bslma::Allocator *allocator,
3355{
3356 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3357 a5, a6, a7, a8, a9);
3359}
3360
3361template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3362 class ARG4, class ARG5, class ARG6, class ARG7,
3363 class ARG8, class ARG9>
3364inline
3365void
3367 TARGET_TYPE *address,
3368 const ARG1& a1,
3369 const ARG2& a2,
3370 const ARG3& a3,
3371 const ARG4& a4,
3372 const ARG5& a5,
3373 const ARG6& a6,
3374 const ARG7& a7,
3375 const ARG8& a8,
3376 const ARG9& a9,
3377 bslma::Allocator *allocator,
3379{
3380 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, allocator);
3382}
3383
3384template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3385 class ARG4, class ARG5, class ARG6, class ARG7,
3386 class ARG8, class ARG9>
3387inline
3388void
3390 const ARG1& a1,
3391 const ARG2& a2,
3392 const ARG3& a3,
3393 const ARG4& a4,
3394 const ARG5& a5,
3395 const ARG6& a6,
3396 const ARG7& a7,
3397 const ARG8& a8,
3398 const ARG9& a9,
3401{
3402 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9);
3404}
3405
3406template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3407 class ARG4, class ARG5, class ARG6, class ARG7,
3408 class ARG8, class ARG9, class ARG10>
3409inline
3410void
3412 TARGET_TYPE *address,
3413 const ARG1& a1,
3414 const ARG2& a2,
3415 const ARG3& a3,
3416 const ARG4& a4,
3417 const ARG5& a5,
3418 const ARG6& a6,
3419 const ARG7& a7,
3420 const ARG8& a8,
3421 const ARG9& a9,
3422 const ARG10& a10,
3423 bslma::Allocator *allocator,
3425{
3426 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3427 a5, a6, a7, a8, a9, a10);
3429}
3430
3431template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3432 class ARG4, class ARG5, class ARG6, class ARG7,
3433 class ARG8, class ARG9, class ARG10>
3434inline
3435void
3437 TARGET_TYPE *address,
3438 const ARG1& a1,
3439 const ARG2& a2,
3440 const ARG3& a3,
3441 const ARG4& a4,
3442 const ARG5& a5,
3443 const ARG6& a6,
3444 const ARG7& a7,
3445 const ARG8& a8,
3446 const ARG9& a9,
3447 const ARG10& a10,
3448 bslma::Allocator *allocator,
3450{
3451 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
3452 allocator);
3454}
3455
3456template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3457 class ARG4, class ARG5, class ARG6, class ARG7,
3458 class ARG8, class ARG9, class ARG10>
3459inline
3460void
3462 const ARG1& a1,
3463 const ARG2& a2,
3464 const ARG3& a3,
3465 const ARG4& a4,
3466 const ARG5& a5,
3467 const ARG6& a6,
3468 const ARG7& a7,
3469 const ARG8& a8,
3470 const ARG9& a9,
3471 const ARG10& a10,
3474{
3475 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
3477}
3478
3479template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3480 class ARG4, class ARG5, class ARG6, class ARG7,
3481 class ARG8, class ARG9, class ARG10, class ARG11>
3482inline
3483void
3485 TARGET_TYPE *address,
3486 const ARG1& a1,
3487 const ARG2& a2,
3488 const ARG3& a3,
3489 const ARG4& a4,
3490 const ARG5& a5,
3491 const ARG6& a6,
3492 const ARG7& a7,
3493 const ARG8& a8,
3494 const ARG9& a9,
3495 const ARG10& a10,
3496 const ARG11& a11,
3497 bslma::Allocator *allocator,
3499{
3500 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3501 a5, a6, a7, a8, a9, a10, a11);
3503}
3504
3505template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3506 class ARG4, class ARG5, class ARG6, class ARG7,
3507 class ARG8, class ARG9, class ARG10, class ARG11>
3508inline
3509void
3511 TARGET_TYPE *address,
3512 const ARG1& a1,
3513 const ARG2& a2,
3514 const ARG3& a3,
3515 const ARG4& a4,
3516 const ARG5& a5,
3517 const ARG6& a6,
3518 const ARG7& a7,
3519 const ARG8& a8,
3520 const ARG9& a9,
3521 const ARG10& a10,
3522 const ARG11& a11,
3523 bslma::Allocator *allocator,
3525{
3526 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11,
3527 allocator);
3529}
3530
3531template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3532 class ARG4, class ARG5, class ARG6, class ARG7,
3533 class ARG8, class ARG9, class ARG10, class ARG11>
3534inline
3535void
3537 const ARG1& a1,
3538 const ARG2& a2,
3539 const ARG3& a3,
3540 const ARG4& a4,
3541 const ARG5& a5,
3542 const ARG6& a6,
3543 const ARG7& a7,
3544 const ARG8& a8,
3545 const ARG9& a9,
3546 const ARG10& a10,
3547 const ARG11& a11,
3550{
3551 ::new (address) TARGET_TYPE(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
3553}
3554
3555template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3556 class ARG4, class ARG5, class ARG6, class ARG7,
3557 class ARG8, class ARG9, class ARG10, class ARG11,
3558 class ARG12>
3559inline
3560void
3562 TARGET_TYPE *address,
3563 const ARG1& a1,
3564 const ARG2& a2,
3565 const ARG3& a3,
3566 const ARG4& a4,
3567 const ARG5& a5,
3568 const ARG6& a6,
3569 const ARG7& a7,
3570 const ARG8& a8,
3571 const ARG9& a9,
3572 const ARG10& a10,
3573 const ARG11& a11,
3574 const ARG12& a12,
3575 bslma::Allocator *allocator,
3577{
3578 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3579 a5, a6, a7, a8, a9, a10, a11, a12);
3581}
3582
3583template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3584 class ARG4, class ARG5, class ARG6, class ARG7,
3585 class ARG8, class ARG9, class ARG10, class ARG11,
3586 class ARG12>
3587inline
3588void
3590 TARGET_TYPE *address,
3591 const ARG1& a1,
3592 const ARG2& a2,
3593 const ARG3& a3,
3594 const ARG4& a4,
3595 const ARG5& a5,
3596 const ARG6& a6,
3597 const ARG7& a7,
3598 const ARG8& a8,
3599 const ARG9& a9,
3600 const ARG10& a10,
3601 const ARG11& a11,
3602 const ARG12& a12,
3603 bslma::Allocator *allocator,
3605{
3606 ::new (address) TARGET_TYPE(
3607 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12,
3608 allocator);
3610}
3611
3612template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3613 class ARG4, class ARG5, class ARG6, class ARG7,
3614 class ARG8, class ARG9, class ARG10, class ARG11,
3615 class ARG12>
3616inline
3617void
3619 const ARG1& a1,
3620 const ARG2& a2,
3621 const ARG3& a3,
3622 const ARG4& a4,
3623 const ARG5& a5,
3624 const ARG6& a6,
3625 const ARG7& a7,
3626 const ARG8& a8,
3627 const ARG9& a9,
3628 const ARG10& a10,
3629 const ARG11& a11,
3630 const ARG12& a12,
3633{
3634 ::new (address) TARGET_TYPE(
3635 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
3637}
3638
3639template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3640 class ARG4, class ARG5, class ARG6, class ARG7,
3641 class ARG8, class ARG9, class ARG10, class ARG11,
3642 class ARG12, class ARG13>
3643inline
3644void
3646 TARGET_TYPE *address,
3647 const ARG1& a1,
3648 const ARG2& a2,
3649 const ARG3& a3,
3650 const ARG4& a4,
3651 const ARG5& a5,
3652 const ARG6& a6,
3653 const ARG7& a7,
3654 const ARG8& a8,
3655 const ARG9& a9,
3656 const ARG10& a10,
3657 const ARG11& a11,
3658 const ARG12& a12,
3659 const ARG13& a13,
3660 bslma::Allocator *allocator,
3662{
3663 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3664 a5, a6, a7, a8, a9, a10, a11, a12, a13);
3666}
3667
3668template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3669 class ARG4, class ARG5, class ARG6, class ARG7,
3670 class ARG8, class ARG9, class ARG10, class ARG11,
3671 class ARG12, class ARG13>
3672inline
3673void
3675 TARGET_TYPE *address,
3676 const ARG1& a1,
3677 const ARG2& a2,
3678 const ARG3& a3,
3679 const ARG4& a4,
3680 const ARG5& a5,
3681 const ARG6& a6,
3682 const ARG7& a7,
3683 const ARG8& a8,
3684 const ARG9& a9,
3685 const ARG10& a10,
3686 const ARG11& a11,
3687 const ARG12& a12,
3688 const ARG13& a13,
3689 bslma::Allocator *allocator,
3691{
3692 ::new (address) TARGET_TYPE(
3693 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13,
3694 allocator);
3696}
3697
3698template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3699 class ARG4, class ARG5, class ARG6, class ARG7,
3700 class ARG8, class ARG9, class ARG10, class ARG11,
3701 class ARG12, class ARG13>
3702inline
3703void
3705 const ARG1& a1,
3706 const ARG2& a2,
3707 const ARG3& a3,
3708 const ARG4& a4,
3709 const ARG5& a5,
3710 const ARG6& a6,
3711 const ARG7& a7,
3712 const ARG8& a8,
3713 const ARG9& a9,
3714 const ARG10& a10,
3715 const ARG11& a11,
3716 const ARG12& a12,
3717 const ARG13& a13,
3720{
3721 ::new (address) TARGET_TYPE(
3722 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
3724}
3725
3726template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3727 class ARG4, class ARG5, class ARG6, class ARG7,
3728 class ARG8, class ARG9, class ARG10, class ARG11,
3729 class ARG12, class ARG13, class ARG14>
3730inline
3731void
3733 TARGET_TYPE *address,
3734 const ARG1& a1,
3735 const ARG2& a2,
3736 const ARG3& a3,
3737 const ARG4& a4,
3738 const ARG5& a5,
3739 const ARG6& a6,
3740 const ARG7& a7,
3741 const ARG8& a8,
3742 const ARG9& a9,
3743 const ARG10& a10,
3744 const ARG11& a11,
3745 const ARG12& a12,
3746 const ARG13& a13,
3747 const ARG14& a14,
3748 bslma::Allocator *allocator,
3750{
3751 ::new (address) TARGET_TYPE(bsl::allocator_arg, allocator, a1, a2, a3, a4,
3752 a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
3754}
3755
3756template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3757 class ARG4, class ARG5, class ARG6, class ARG7,
3758 class ARG8, class ARG9, class ARG10, class ARG11,
3759 class ARG12, class ARG13, class ARG14>
3760inline
3761void
3763 TARGET_TYPE *address,
3764 const ARG1& a1,
3765 const ARG2& a2,
3766 const ARG3& a3,
3767 const ARG4& a4,
3768 const ARG5& a5,
3769 const ARG6& a6,
3770 const ARG7& a7,
3771 const ARG8& a8,
3772 const ARG9& a9,
3773 const ARG10& a10,
3774 const ARG11& a11,
3775 const ARG12& a12,
3776 const ARG13& a13,
3777 const ARG14& a14,
3778 bslma::Allocator *allocator,
3780{
3781 ::new (address) TARGET_TYPE(
3782 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,
3783 allocator);
3785}
3786
3787template <class TARGET_TYPE, class ARG1, class ARG2, class ARG3,
3788 class ARG4, class ARG5, class ARG6, class ARG7,
3789 class ARG8, class ARG9, class ARG10, class ARG11,
3790 class ARG12, class ARG13, class ARG14>
3791inline
3792void
3794 const ARG1& a1,
3795 const ARG2& a2,
3796 const ARG3& a3,
3797 const ARG4& a4,
3798 const ARG5& a5,
3799 const ARG6& a6,
3800 const ARG7& a7,
3801 const ARG8& a8,
3802 const ARG9& a9,
3803 const ARG10& a10,
3804 const ARG11& a11,
3805 const ARG12& a12,
3806 const ARG13& a13,
3807 const ARG14& a14,
3810{
3811 ::new (address) TARGET_TYPE(
3812 a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
3814}
3815
3816 // *** swap overloads: ***
3817
3818template <class LHS_TYPE, class RHS_TYPE>
3820 LHS_TYPE& lhs,
3821 RHS_TYPE& rhs,
3823{
3829 // Detectable at compile-time, this condition ensures that we don't
3830 // call library functions for fundamental types. It also ensures we
3831 // don't bitwise swap types that use allocators, as there is no easy
3832 // way to confirm allocators are the same for an arbitrary 'LHS_TYPE'.
3833 // Note that assignment can throw only for types that use allocators.
3834
3835 char arena[sizeof lhs];
3836 memcpy(arena, BSLS_UTIL_ADDRESSOF(lhs), sizeof lhs);
3837 memcpy((void *)BSLS_UTIL_ADDRESSOF(lhs),
3839 sizeof lhs); // no overlap, or identical
3840 memcpy((void *)BSLS_UTIL_ADDRESSOF(rhs), arena, sizeof lhs);
3841 } else {
3842 LHS_TYPE temp(lhs);
3843 lhs = rhs;
3844 rhs = temp;
3845 }
3846}
3847
3848template <class LHS_TYPE, class RHS_TYPE>
3850 RHS_TYPE& rhs,
3852{
3853 LHS_TYPE temp(lhs);
3854 lhs = rhs;
3855 rhs = temp;
3856}
3857
3858} // close package namespace
3859
3860#ifndef BDE_OPENSOURCE_PUBLICATION // BACKWARD_COMPATIBILITY
3861// ============================================================================
3862// BACKWARD COMPATIBILITY
3863// ============================================================================
3864
3865/// This alias is defined for backward compatibility.
3867#endif // BDE_OPENSOURCE_PUBLICATION -- BACKWARD_COMPATIBILITY
3868
3869
3870
3871#endif
3872
3873// ----------------------------------------------------------------------------
3874// Copyright 2013 Bloomberg Finance L.P.
3875//
3876// Licensed under the Apache License, Version 2.0 (the "License");
3877// you may not use this file except in compliance with the License.
3878// You may obtain a copy of the License at
3879//
3880// http://www.apache.org/licenses/LICENSE-2.0
3881//
3882// Unless required by applicable law or agreed to in writing, software
3883// distributed under the License is distributed on an "AS IS" BASIS,
3884// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3885// See the License for the specific language governing permissions and
3886// limitations under the License.
3887// ----------------------------- END-OF-FILE ----------------------------------
3888
3889/** @} */
3890/** @} */
3891/** @} */
#define BSLALG_SCALARPRIMITIVES_XLC_PLACEMENT_NEW_FIX
Definition bslalg_scalarprimitives.h:1547
Definition bslma_allocator.h:457
bslalg::ScalarPrimitives bslalg_ScalarPrimitives
This alias is defined for backward compatibility.
Definition bslalg_scalarprimitives.h:3866
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_UTIL_ADDRESSOF(OBJ)
Definition bsls_util.h:289
Definition bdlc_flathashmap.h:1805
Definition bslmf_integralconstant.h:244
Definition bslmf_isfundamental.h:329
Definition bslmf_ispointer.h:138
Definition bslmf_issame.h:146
Definition bslmf_istriviallydefaultconstructible.h:293
Definition bslalg_scalarprimitives.h:670
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:2593
static void defaultConstruct(TARGET_TYPE *address, bslma::Allocator *allocator, bsl::integral_constant< int, e_USES_ALLOCATOR_ARG_T_TRAITS > *)
Definition bslalg_scalarprimitives.h:2511
static void construct(TARGET_TYPE *address, const ARG1 &a1, bslma::Allocator *allocator, bsl::integral_constant< int, e_BITWISE_COPYABLE_TRAITS > *)
Definition bslalg_scalarprimitives.h:2869
static void swap(LHS_TYPE &lhs, RHS_TYPE &rhs, bsl::integral_constant< int, e_BITWISE_MOVEABLE_TRAITS > *)
Definition bslalg_scalarprimitives.h:3819
static TARGET_TYPE * unconst(const TARGET_TYPE *pointer)
Definition bslalg_scalarprimitives.h:2501
@ e_USES_ALLOCATOR_ARG_T_TRAITS
Definition bslalg_scalarprimitives.h:678
@ e_HAS_TRIVIAL_DEFAULT_CTOR_TRAITS
Definition bslalg_scalarprimitives.h:680
@ e_BITWISE_MOVEABLE_TRAITS
Definition bslalg_scalarprimitives.h:682
@ e_BITWISE_COPYABLE_TRAITS
Definition bslalg_scalarprimitives.h:681
@ e_USES_BSLMA_ALLOCATOR_TRAITS
Definition bslalg_scalarprimitives.h:679
@ e_NIL_TRAITS
Definition bslalg_scalarprimitives.h:683
static void destructiveMove(TARGET_TYPE *address, TARGET_TYPE *original, ALLOCATOR *allocator, bsl::integral_constant< int, e_BITWISE_MOVEABLE_TRAITS > *)
Definition bslalg_scalarprimitives.h:2823
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:2711
Definition bslalg_scalarprimitives.h:170
static void defaultConstruct(TARGET_TYPE *address, bslma::Allocator *allocator)
Definition bslalg_scalarprimitives.h:1559
static void moveConstruct(TARGET_TYPE *address, TARGET_TYPE &original, bslma::Allocator *allocator)
Definition bslalg_scalarprimitives.h:1642
static void destruct(TARGET_TYPE *object, void *allocator)
Definition bslalg_scalarprimitives.h:2462
static void destructiveMove(TARGET_TYPE *address, TARGET_TYPE *original, ALLOCATOR *allocator)
Definition bslalg_scalarprimitives.h:1685
static void copyConstruct(TARGET_TYPE *address, const TARGET_TYPE &original, bslma::Allocator *allocator)
Definition bslalg_scalarprimitives.h:1599
static void construct(TARGET_TYPE *address, bslma::Allocator *allocator)
Definition bslalg_scalarprimitives.h:1708
static void swap(LHS_TYPE &lhs, RHS_TYPE &rhs)
Definition bslalg_scalarprimitives.h:2483
Definition bslma_usesbslmaallocator.h:343
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:1060
Definition bslmf_usesallocatorargt.h:100