[#BloombergLP-bslalg-ArrayPrimitives-defaultConstruct-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::defaultConstruct
:relfileprefix: ../../../
:mrdocs:

Value&hyphen;initialize elements into an uninitialized array&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
static
void
defaultConstruct(
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer begin,
    xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size&lowbar;type] numElements,
    ALLOCATOR allocator);
----

== Description

Value&hyphen;initialize the specified `numElements` objects of type `allocator&lowbar;traits&lt;ALLOCATOR&gt;&colon;&colon;value&lowbar;type` into the uninitialized array beginning at the specified `begin` location, using the specified `allocator` to supply memory (if required)&period; If a constructor throws an exception during this operation, then the destructor is called on any newly constructed elements, leaving the output array in an uninitialized state&period; The behavior is undefined unless the `begin` refers to space sufficient to hold `numElements`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *begin*
| beginning of the uninitialized destination range
| *numElements*
| number of elements to value&hyphen;initialize
| *allocator*
| allocator used to supply memory if required
|===


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