[#BloombergLP-bdlc-CompactedArray-2constructor-02f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/CompactedArray.adoc[CompactedArray]::CompactedArray
:relfileprefix: ../../../
:mrdocs:

Create a `CompactedArray` having the specified `numElements`&period;

== Synopsis

Declared in `&lt;bdlc&lowbar;compactedarray&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
CompactedArray(
    std::size&lowbar;t numElements,
    TYPE const& value = TYPE(),
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

== Description

Optionally specify a `value` to which each element will be set&period; If `value` is not specified, `TYPE()` is used&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *numElements*
| initial number of elements
| *value*
| value used to initialize each element
| *basicAllocator*
| allocator used to supply memory
|===


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