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

Constructors

== Synopses

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

Create a `Json` object holding the `JsonNull` singleton&period;


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

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

Create a `Json` object by moving from the specified `original`&period;


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

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

Create a `Json` object holding `JsonNull` using `basicAllocator`&period;


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

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

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-061.adoc[Json](
    xref:BloombergLP/bdldfp/Decimal64.adoc[bdldfp::Decimal64] value,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create a `Json` object holding the specified boolean value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-08b.adoc[Json](
    bool boolean,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-06fc.adoc[Json](
    double value,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create a `Json` object holding the specified numeric `value`&period;


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

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

Create a `Json` object holding the specified numeric `value`&period;


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

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

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


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

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

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


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

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

Create a `Json` object holding the specified numeric `value`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-0cc.adoc[Json](
    unsigned int value,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-0bec.adoc[Json](
    unsigned long value,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-0c8.adoc[Json](
    unsigned long long value,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create a `Json` object having the same value as the specified `original`&period; Use the specified `basicAllocator` to supply memory&period;


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

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

Create a `Json` object by moving from the specified `array`&period;


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

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

Create a `Json` object by moving from the specified `number`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-04.adoc[Json](
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;JsonNumber&gt;] number,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

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


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

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

Create a `Json` object having the same value as `original`&period;


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

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

Create a `Json` object holding the specified `array`&period;


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

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

Create a `Json` object holding the `JsonNull` value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-0b0.adoc[Json](
    xref:BloombergLP/bdljsn/JsonNull-0b.adoc[JsonNull] const& null,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create a `Json` object holding the specified `number`&period;


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

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

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


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

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

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-09a.adoc[Json](
    std::string&lowbar;view const& string,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create a `Json` object holding the specified `string`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdljsn/Json/2constructor-0be9.adoc[Json](
    char const* string,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create a `Json` object by moving from the specified `string`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;STRING&lowbar;TYPE&gt;
xref:BloombergLP/bdljsn/Json/2constructor-086.adoc[Json](
    xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef&lowbar;Deduced&lt;t&lowbar;STRING&lowbar;TYPE&gt;] string,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0)
requires bsl&colon;&colon;is&lowbar;same&lt;t&lowbar;STRING&lowbar;TYPE,
                                bsl&colon;&colon;string&gt;&colon;&colon;value;
----

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

Create a `Json` object from the specified `initializer`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;JSON&lowbar;INITIALIZER&gt;
xref:BloombergLP/bdljsn/Json/2constructor-09f.adoc[Json](
    t&lowbar;JSON&lowbar;INITIALIZER const& initializer,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0)
requires bsl&colon;&colon;is&lowbar;same&lt;t&lowbar;JSON&lowbar;INITIALIZER,
                        Json&lowbar;Initializer&gt;&colon;&colon;value;
----

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| source value
| *basicAllocator*
| memory allocator&semi; null uses the default
| *value*
| numeric value to store
| *boolean*
| boolean value to store
| *array*
| array value to store
| *number*
| number value to store
| *object*
| object value to store
| *null*
| null value to store
| *string*
| UTF&hyphen;8 string value to store
| *initializer*
| list&hyphen;initialization value
|===


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