JSON for Modern C++  3.8.0

◆ parse() [3/3]

template<typename IteratorType >
static basic_json nlohmann::basic_json::parse ( IteratorType  first,
IteratorType  last,
const parser_callback_t  cb = nullptr,
const bool  allow_exceptions = true 
)
inlinestatic

The value_type of the iterator must be a integral type with size of 1, 2 or 4 bytes, which will be interpreted respectively as UTF-8, UTF-16 and UTF-32.

Parameters
[in]firstiterator to start of character range
[in]lastiterator to end of character range
[in]cba parser callback function of type parser_callback_t which is used to control the deserialization by filtering unwanted values (optional)
[in]allow_exceptionswhether to throw exceptions in case of a parse error (optional, true by default)
Returns
deserialized JSON value; in case of a parse error and allow_exceptions set to false, the return value will be value_t::discarded.
Exceptions
parse_error.101if a parse error occurs; example: ""unexpected end of input; expected string literal""
parse_error.102if to_unicode fails or surrogate error
parse_error.103if to_unicode fails

Definition at line 22423 of file json.hpp.