[#nlohmann-basic_json-0c-from_cbor-09]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0c.adoc[basic&lowbar;json]::from&lowbar;cbor
:relfileprefix: ../../
:mrdocs:

create a JSON value from an input in CBOR format

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename InputType&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
static
xref:nlohmann/basic_json-0c.adoc[basic&lowbar;json]
from&lowbar;cbor(
    InputType&& i,
    bool const strict = true,
    bool const allow&lowbar;exceptions = true,
    xref:nlohmann/basic_json-0c/cbor_tag_handler_t.adoc[cbor&lowbar;tag&lowbar;handler&lowbar;t] const tag&lowbar;handler = cbor&lowbar;tag&lowbar;handler&lowbar;t&colon;&colon;error);
----

== Return Value

a JSON value representing the input, or a discarded value if `allow&lowbar;exceptions` is `false` and a parse error occurred

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *i*
| an input in CBOR format convertible to an input adapter
| *strict*
| whether to expect the input to be consumed until EOF
| *allow&lowbar;exceptions*
| whether to throw exceptions in case of a parse error
| *tag&lowbar;handler*
| how to treat CBOR tags
|===


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