[#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 `<bdljsn_json.h>` Create an empty `JsonObject`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonObject/2constructor-0b.adoc[JsonObject](); ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/2constructor-0b.adoc[_» more..._]# 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`. The allocator associated with `original` is propagated for use in the newly‐created `JsonObject`. `original` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonObject/2constructor-0e.adoc[JsonObject](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonObject>] original) noexcept; ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/2constructor-0e.adoc[_» more..._]# Create an empty `JsonObject` that uses the specified `basicAllocator` to supply memory. [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..._]# Create a `JsonObject` having the same value as the specified `original`. Use the specified `basicAllocator` to supply memory. If `basicAllocator == original.allocator()` the value of `original` will be moved (in constant time) to the newly‐created `JsonObject`, and `original` will be left in a valid but unspecified state. Otherwise, `original` is copied, and `basicAllocator` used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonObject/2constructor-030.adoc[JsonObject]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonObject>] original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/2constructor-030.adoc[_» more..._]# Create a `JsonObject` having members created (in order) from the specified `memberInitializers`. Member initializers having key values that were previously inserted into the new object are ignored. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used. The behavior is undefined unless the key of each member initializer in `memberInitializers` is valid UTF‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonObject/2constructor-09.adoc[JsonObject]( std::initializer_list<JsonObject_MemberInitializer> memberInitializers, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/2constructor-09.adoc[_» more..._]# Create a `JsonObject` having the same value as the specified `original`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [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..._]# 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. Insert into this `JsonObject` each such object, ignoring those having a key that appears earlier in the sequence. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory. 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 `Member`. 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‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_INPUT_ITERATOR> xref:BloombergLP/bdljsn/JsonObject/2constructor-02.adoc[JsonObject]( t_INPUT_ITERATOR first, t_INPUT_ITERATOR last, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/2constructor-02.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#