[#BloombergLP-bdljsn-JsonArray-2constructor-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray]::JsonArray
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;bdljsn&lowbar;json&period;h&gt;`

Create an empty `JsonArray`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, the currently installed default allocator is used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/JsonArray/2constructor-00c.adoc[JsonArray]();
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-00c.adoc[_» more&period;&period;&period;_]#

Create a `JsonArray` having the same value as the specified `original` object by moving (in constant time) the contents of `original` to the new `JsonArray` object&period; The allocator associated with `original` is propagated for use in the newly&hyphen;created `JsonArray` object&period; `original` is left in a valid but unspecified state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/JsonArray/2constructor-0b.adoc[JsonArray](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;JsonArray&gt;] original) noexcept;
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-0b.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `JsonArray`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/JsonArray/2constructor-03.adoc[JsonArray](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator);
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-03.adoc[_» more&period;&period;&period;_]#

Create a `JsonArray` having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory&period; The contents of `original` are moved (in constant time) to the new `JsonArray` object if `basicAllocator &equals;&equals; original&period;allocator()`, and are move&hyphen;inserted (in linear time) using `basicAllocator` otherwise&period; `original` is left in a valid but unspecified state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/JsonArray/2constructor-09.adoc[JsonArray](
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;JsonArray&gt;] original,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator);
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-09.adoc[_» more&period;&period;&period;_]#

Create a `JsonArray` having a `Json` object for each element (in order) of the specified `elements`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, the currently installed default allocator is used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/JsonArray/2constructor-0c.adoc[JsonArray](
    std::initializer&lowbar;list&lt;Json&lowbar;Initializer&gt; elements,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-0c.adoc[_» more&period;&period;&period;_]#

Create a `JsonArray` having the same value as the specified `original` object&period; Optionally specify `basicAllocator` to supply memory&period; If `basicAllocator` is not specified, the allocator associated with `original` is propagated for use in the newly&hyphen;created `JsonArray`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/JsonArray/2constructor-002.adoc[JsonArray](
    xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray] const& original,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-002.adoc[_» more&period;&period;&period;_]#

Create a `JsonArray` and insert (in order) each `Json` object in the range starting at the specified `first` element, and ending immediately before the specified `last` element&period; Optionally specify `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, the currently installed default allocator is used&period; Throw `bsl&colon;&colon;length&lowbar;error` if the number of elements in `&lsqb;first &period;&period; last)&rsqb;` exceeds the value returned by the method `maxSize`&period; The (template parameter) type `t&lowbar;INPUT&lowbar;ITERATOR` shall meet the requirements of an input iterator defined in the c&plus;&plus;11 standard &lsqb;24&period;2&period;3&rsqb;providing access to values of a type convertible to `Json`, and `Json` must be `emplace&hyphen;constructible` form `&ast;i`, where `i` is a dereferenceable iterator in the range `&lsqb;first &period;&period; last)&rsqb;`&period; The behavior is undefined unless `first` and `last` refer to a range of valid values where `first` is at a position at or before `last`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdljsn/JsonArray/2constructor-0a.adoc[JsonArray](
    t&lowbar;INPUT&lowbar;ITERATOR first,
    t&lowbar;INPUT&lowbar;ITERATOR last,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-0a.adoc[_» more&period;&period;&period;_]#


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