[#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 `<bdljsn_json.h>` Create an empty `JsonArray`. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonArray/2constructor-00c.adoc[JsonArray](); ---- [.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-00c.adoc[_» more..._]# 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. The allocator associated with `original` is propagated for use in the newly‐created `JsonArray` object. `original` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonArray/2constructor-0b.adoc[JsonArray](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonArray>] original) noexcept; ---- [.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-0b.adoc[_» more..._]# Same as the related overload above for `JsonArray`. [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..._]# Create a `JsonArray` having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory. The contents of `original` are moved (in constant time) to the new `JsonArray` object if `basicAllocator == original.allocator()`, and are move‐inserted (in linear time) using `basicAllocator` otherwise. `original` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonArray/2constructor-09.adoc[JsonArray]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonArray>] original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-09.adoc[_» more..._]# Create a `JsonArray` having a `Json` object for each element (in order) of the specified `elements`. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonArray/2constructor-0c.adoc[JsonArray]( std::initializer_list<Json_Initializer> elements, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-0c.adoc[_» more..._]# Create a `JsonArray` having the same value as the specified `original` object. Optionally specify `basicAllocator` to supply memory. If `basicAllocator` is not specified, the allocator associated with `original` is propagated for use in the newly‐created `JsonArray`. [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..._]# 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. Optionally specify `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used. Throw `bsl::length_error` if the number of elements in `[first .. last)]` exceeds the value returned by the method `maxSize`. The (template parameter) type `t_INPUT_ITERATOR` shall meet the requirements of an input iterator defined in the c++11 standard [24.2.3]providing access to values of a type convertible to `Json`, and `Json` must be `emplace‐constructible` form `*i`, where `i` is a dereferenceable iterator in the range `[first .. last)]`. 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`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_INPUT_ITERATOR> xref:BloombergLP/bdljsn/JsonArray/2constructor-0a.adoc[JsonArray]( t_INPUT_ITERATOR first, t_INPUT_ITERATOR last, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/JsonArray/2constructor-0a.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#