[#BloombergLP-bdljsn-Json-operator_assign-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/Json.adoc[Json]::operator&equals;
:relfileprefix: ../../../
:mrdocs:

Assignment operators

== Synopses

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

Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period; The value currently held by this variant is destroyed if that value&apos;s type is not the same as the type held by the `rhs` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0ff.adoc[operator&equals;](xref:BloombergLP/bdljsn/Json.adoc[Json] const& rhs);
----

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

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-08b.adoc[operator&equals;](xref:BloombergLP/bdldfp/Decimal64.adoc[bdldfp::Decimal64] rhs);
----

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

Assign to this object a value of type `bool` initialized from the specified `rhs`, and return a reference providing modifiable access to this object&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `bool`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-02.adoc[operator&equals;](bool rhs);
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_assign-02.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-04.adoc[operator&equals;](double rhs);
----

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

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0e.adoc[operator&equals;](float rhs);
----

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

Assign to this object a value of type `JsonNumber` initialized from the specified `rhs`, and return a reference providing modifiable access to this object&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonNumber`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0b8.adoc[operator&equals;](int rhs);
----

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

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0b3.adoc[operator&equals;](long rhs);
----

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

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-080.adoc[operator&equals;](long long rhs);
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_assign-080.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0c.adoc[operator&equals;](unsigned int rhs);
----

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

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-054.adoc[operator&equals;](unsigned long rhs);
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_assign-054.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-03e.adoc[operator&equals;](unsigned long long rhs);
----

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

Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period; The contents of `rhs` are moved (in constant time) to this `Json` object if `allocator() &equals;&equals; rhs&period;allocator()`&semi; otherwise they are copied&period; `rhs` is left in a valid but unspecified state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-09.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;Json&gt;] rhs);
----

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

Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period; The contents of `rhs` are moved (in constant time) to this `Json` object if `allocator() &equals;&equals; rhs&period;allocator()`&semi; otherwise, they are copied&period; `rhs` is left in a valid but unspecified state&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonArray`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0d.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;JsonArray&gt;] rhs);
----

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

Assign to this object the singleton value of type `JsonNull`, and return a reference providing modifiable access to this object&period; `rhs` is left in a valid but unspecified state&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonNull`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0a.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;JsonNull&gt;]);
----

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

Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period; The contents of `rhs` are moved (in constant time) to this `Json` object if `allocator() &equals;&equals; rhs&period;allocator()`&semi; otherwise, they are copied&period; `rhs` is left in a valid but unspecified state&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonNumber`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0bc.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;JsonNumber&gt;] rhs);
----

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

Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period; The contents of `rhs` are moved (in constant time) to this `Json` object if `allocator() &equals;&equals; rhs&period;allocator()`&semi; otherwise, they are copied&period; `rhs` is left in a valid but unspecified state&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonObject`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-050.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;JsonObject&gt;] rhs);
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_assign-050.adoc[_» more&period;&period;&period;_]#

Assign to this object a value of type `JsonArray` initialized from the specified `rhs`, and return a reference providing modifiable access to this object&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonArray`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0f9.adoc[operator&equals;](xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray] const& rhs);
----

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

Assign to this object the singleton value of type `JsonNull`, and return a reference providing modifiable access to this object&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonNull`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-03f.adoc[operator&equals;](xref:BloombergLP/bdljsn/JsonNull-0b.adoc[JsonNull] const&);
----

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

Assign to this object a value of type `JsonNumber` initialized from the specified `rhs`, and return a reference providing modifiable access to this object&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonNumber`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-00.adoc[operator&equals;](xref:BloombergLP/bdljsn/JsonNumber.adoc[JsonNumber] const& rhs);
----

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

Assign to this object a value of type `JsonObject` initialized from the specified `rhs`, and return a reference providing modifiable access to this object&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `JsonObject`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-053.adoc[operator&equals;](xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject] const& rhs);
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_assign-053.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `operator&equals;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-01.adoc[operator&equals;](std::string&lowbar;view const& rhs);
----

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

Assign to this object a value of type `bsl&colon;&colon;string` initialized from the specified `rhs`, and return a reference providing modifiable access to this object&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `bsl&colon;&colon;string`&period; The behavior is undefined unless `rhs` is valid UTF&hyphen;8 (see `bdlde&colon;&colon;Utf8Util&colon;&colon;isValid`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-0b6.adoc[operator&equals;](char const* rhs);
----

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

Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period; The contents of `rhs` are moved (in constant time) to this `Json` object if `allocator() &equals;&equals; rhs&period;allocator()`&semi; otherwise, they are copied&period; `rhs` is left in a valid but unspecified state&period; The value currently held by this object (if any) is destroyed if that value&apos;s type is not `bsl&colon;&colon;string`&period; This function does not participate in overload resolution unless the specified `t&lowbar;STRING&lowbar;TYPE` is `bsl&colon;&colon;string`&period; The behavior is undefined unless `rhs` is 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;STRING&lowbar;TYPE&gt;
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_assign-058.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef&lowbar;Deduced&lt;t&lowbar;STRING&lowbar;TYPE&gt;] rhs)
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/operator_assign-058.adoc[_» more&period;&period;&period;_]#


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