[#BloombergLP-bdljsn-JsonObject-2constructor-01]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject]::JsonObject
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

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


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

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

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


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

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

Create an empty `JsonObject` that uses the specified `basicAllocator` to supply memory&period;


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

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

Create a `JsonObject` having the same value as the specified `original`&period; Use the specified `basicAllocator` to supply memory&period; If `basicAllocator &equals;&equals; original&period;allocator()` the value of `original` will be moved (in constant time) to the newly&hyphen;created `JsonObject`, and `original` will be left in a valid but unspecified state&period; Otherwise, `original` is copied, and `basicAllocator` used to supply memory&period;


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

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

Create a `JsonObject` having members created (in order) from the specified `memberInitializers`&period; Member initializers having key values that were previously inserted into the new object are ignored&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, the currently installed default allocator is used&period; The behavior is undefined unless the key of each member initializer in `memberInitializers` is valid UTF&hyphen;8 (see `bdlde&colon;&colon;Utf8Util&colon;&colon;isValid`)&period;


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

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

Create a `JsonObject` having the same value as the specified `original`&period; Optionally specify the `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory&period;


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

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

Create an empty `JsonObject`, and then create a `Json` object for each iterator in the range starting at the specified `first` iterator and ending immediately before the specified `last` iterator, by converting from the object referred to by each iterator&period; Insert into this `JsonObject` each such object, ignoring those having a key that appears earlier in the sequence&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory&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 `Member`&period; The behavior is undefined unless `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`, and all keys of all `Member` objects inserted are valid UTF&hyphen;8 (see `bdlde&colon;&colon;Utf8Util&colon;&colon;isValid`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdljsn/JsonObject/2constructor-02.adoc[JsonObject](
    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/JsonObject/2constructor-02.adoc[_» more&period;&period;&period;_]#


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