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

Create a `Json` object having the type `bsl&colon;&colon;string` and the same value as the specified `string` by moving (in constant time) the contents of `string` to the new `Json` object&period; Optionally specify the `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, the allocator associated with `string` is propagated for use in the newly&hyphen;created `Json` object&period; `string` is left in a valid but unspecified state&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 `string` is valid UTF&hyphen;8 (see `bdlde&colon;&colon;Utf8Util&colon;&colon;isValid`)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;STRING&lowbar;TYPE&gt;
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,
    void* = 0)
requires bsl&colon;&colon;is&lowbar;same&lt;t&lowbar;STRING&lowbar;TYPE,
                                bsl&colon;&colon;string&gt;&colon;&colon;value;
----


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