[#BloombergLP-bslalg-ArrayPrimitives-uninitializedFillN-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::uninitializedFillN
:relfileprefix: ../../../
:mrdocs:

Fill an uninitialized array with copies of a value&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
uninitializedFillN(
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::pointer begin,
    xref:BloombergLP/bslalg/ArrayPrimitives/size_type.adoc[size&lowbar;type] numElements,
    bsl::allocator&lowbar;traits&lt;ALLOCATOR&gt;::value&lowbar;type const& value,
    ALLOCATOR allocator);
----

== Description

Construct copies of the specified `value` of type given by the `allocator&lowbar;traits` class template for (template parameter) `ALLOCATOR` into the uninitialized array containing the specified `numElements` starting at the specified `begin` location&period; The behavior is undefined unless the output array contains at least `numElements` uninitialized elements after `begin`&period; If a constructor throws an exception during the operation, then the destructor is called on any newly&hyphen;constructed elements, leaving the output array in an uninitialized state&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *begin*
| beginning of the uninitialized destination range
| *numElements*
| number of copies of `value` to construct
| *value*
| value copied into each constructed element
| *allocator*
| allocator used to supply memory if required
|===


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