[#nlohmann-basic_json-05-2constructor-06]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-05.adoc[basic&lowbar;json&lt;&gt;]::basic&lowbar;json
:relfileprefix: ../../
:mrdocs:

create a JSON value from compatible types

== Synopsis

Declared in `&lt;nlohmann&sol;json&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename CompatibleType,
    typename U = detail::uncvref&lowbar;t&lt;CompatibleType&gt;&gt;
requires !detail&colon;&colon;is&lowbar;basic&lowbar;json&lt;U&gt;&colon;&colon;value &amp;&amp; detail&colon;&colon;is&lowbar;compatible&lowbar;type&lt;basic&lowbar;json&lowbar;t, U&gt;&colon;&colon;value
basic&lowbar;json(CompatibleType&& val) noexcept(noexcept(JSONSerializer&lt;U, void&gt;&colon;&colon;to&lowbar;json(std&colon;&colon;declval&lt;basic&lowbar;json&lowbar;t &amp;&gt;(), std&colon;&colon;forward&lt;CompatibleType&gt;(val))));
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *val*
| The object to move construct from
|===


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