[#nlohmann-adl_serializer-to_json]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/adl_serializer.adoc[adl&lowbar;serializer]::to&lowbar;json
:relfileprefix: ../../
:mrdocs:

convert any value type to a JSON value

== Synopsis

Declared in `&lt;nlohmann&sol;adl&lowbar;serializer&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename BasicJsonType,
    typename TargetType = ValueType&gt;
static
decltype(&colon;&colon;nlohmann&colon;&colon;to&lowbar;json(j, std&colon;&colon;forward&lt;TargetType&gt;(val)), void())
to&lowbar;json(
    BasicJsonType& j,
    TargetType&& val) noexcept(noexcept(&colon;&colon;nlohmann&colon;&colon;to&lowbar;json(j, std&colon;&colon;forward&lt;TargetType&gt;(val))));
----


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