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

Build a default&hyphen;initialized object of the parameterized `TARGET&lowbar;TYPE` in the uninitialized memory at the specified `address`, as if by using the `TARGET&lowbar;TYPE` default constructor&period; If the specified `allocator` is based on `bslma&colon;&colon;Allocator` and `TARGET&lowbar;TYPE` takes an allocator constructor argument, then `allocator` is passed to the default constructor&period; If the constructor throws, the `address` is left in an uninitialized state&period; Note that this operation may bypass the constructor and simply fill memory with 0 if `TARGET&lowbar;TYPE` has the trivial default constructor trait and does not use `bslma&colon;&colon;Allocator`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TARGET&lowbar;TYPE&gt;
static
void
defaultConstruct(
    TARGET&lowbar;TYPE* address,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator);
----


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