[#nlohmann-basic_json-0c-from_msgpack-05]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0c.adoc[basic&lowbar;json]::from&lowbar;msgpack
:relfileprefix: ../../
:mrdocs:

create a JSON value from an input in MessagePack format (iterator pair, or iterator&plus;sentinel pair for C&plus;&plus;20 ranges support)

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename IteratorType,
    typename SentinelType = IteratorType&gt;
requires detail&colon;&colon;can&lowbar;compare&lowbar;ne&lt;IteratorType, SentinelType&gt;&colon;&colon;value
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
static
xref:nlohmann/basic_json-0c.adoc[basic&lowbar;json]
from&lowbar;msgpack(
    IteratorType first,
    SentinelType last,
    bool const strict = true,
    bool const allow&lowbar;exceptions = true);
----

== 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
| *first*
| iterator to the start of the input
| *last*
| iterator to the end of the input, or a sentinel value comparable to _first_
| *strict*
| whether to expect the input to be consumed until EOF
| *allow&lowbar;exceptions*
| whether to throw exceptions in case of a parse error
|===


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