[#BloombergLP-bslalg-ScalarPrimitives]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::ScalarPrimitives
:relfileprefix: ../../
:mrdocs:

This `struct` provides a namespace for a suite of utility functions that operate on elements of a parameterized type `TARGET&lowbar;TYPE`&period; If any of the `&period;&period;&period;Construct` methods throws, then its target `address` is left uninitialized and there are no effects, unless otherwise mentioned in the documentation&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;scalarprimitives&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct ScalarPrimitives;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/ScalarPrimitives/construct-044.adoc[`construct`] 
| `construct` overloads
| xref:BloombergLP/bslalg/ScalarPrimitives/copyConstruct-09.adoc[`copyConstruct`] 
| `copyConstruct` overloads
| xref:BloombergLP/bslalg/ScalarPrimitives/defaultConstruct-015.adoc[`defaultConstruct`] 
| `defaultConstruct` overloads
| xref:BloombergLP/bslalg/ScalarPrimitives/destruct-01.adoc[`destruct`] 
| `destruct` overloads
| xref:BloombergLP/bslalg/ScalarPrimitives/destructiveMove.adoc[`destructiveMove`] 
| Move the state of the object of the parameterized `TARGET&lowbar;TYPE` from the object at the specified `original` address to the uninitialized memory at the specified `address`, as if by move constructing and then destroying the original&period; If the parameterized `ALLOCATOR` is based on `bslma&colon;&colon;Allocator` and `TARGET&lowbar;TYPE` takes an allocator constructor argument, then the moved object uses the specified `allocator` to supply memory&period; If the move constructor throws, the `address` is left in an uninitialized state and the `original` is left unchanged&period; The behavior is undefined unless the `original` object also uses the `allocator`&period; Note that bit&hyphen;wise copy will be used and `allocator` will be ignored if TARGET&lowbar;TYPE&apos; has the bit&hyphen;wise moveable trait&period; Note that, if `ALLOCATOR` is not based on `bslma&colon;&colon;Allocator`, then the `allocator` argument is ignored&semi; the allocator used by the resulting object at `address` might or might not be the same as the allocator used by `original`, depending on whether `TARGET&lowbar;TYPE` has a move constructor (C&plus;&plus;11)&period;
| xref:BloombergLP/bslalg/ScalarPrimitives/moveConstruct-0f.adoc[`moveConstruct`] 
| `moveConstruct` overloads
| xref:BloombergLP/bslalg/ScalarPrimitives/swap.adoc[`swap`] 
| Swap the contents of the specified `lhs` of the parameterized `LHS&lowbar;TYPE` with those of the specified `rhs` of the parameterized `RHS&lowbar;TYPE`&period; Note that, if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are the same type and that type has the bit&hyphen;wise moveable trait but does not use `bslma` allocators, the swap can be performed using a three&hyphen;way bit&hyphen;wise move&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
