Member @a byte holds the byte index of the last read character in the input
Member @a byte holds the byte index of the last read character in the input
file.
file.
@note For an input with n bytes, 1 is the index of the first character and n+1
is the index of the terminating null byte or the end of file. This also
holds true when reading a byte vector (CBOR or MessagePack).
Exceptions have ids 1xx.
Exceptions have ids 1xx.
name / id | example message | description
name / id | example message | description
...
@@ -247,6 +243,10 @@ json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vect
...
@@ -247,6 +243,10 @@ json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vect
json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xf8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read.
json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xf8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read.
json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read.
json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read.
@note For an input with n bytes, 1 is the index of the first character and n+1
is the index of the terminating null byte or the end of file. This also
holds true when reading a byte vector (CBOR or MessagePack).
@liveexample{The following code shows how a `parse_error` exception can be
@liveexample{The following code shows how a `parse_error` exception can be
caught.,parse_error}
caught.,parse_error}
...
@@ -11279,9 +11279,9 @@ class basic_json
...
@@ -11279,9 +11279,9 @@ class basic_json
/// @{
/// @{
/*!
/*!
@brief checks whether the container is empty
@brief checks whether the container is empty.
Checks if a JSON value has no elements.
Checks if a JSON value has no elements (i.e. whether its @ref size is `0`).
@return The return value depends on the different types and is
@return The return value depends on the different types and is
defined as follows:
defined as follows:
...
@@ -11294,23 +11294,27 @@ class basic_json
...
@@ -11294,23 +11294,27 @@ class basic_json
object | result of function `object_t::empty()`
object | result of function `object_t::empty()`
array | result of function `array_t::empty()`
array | result of function `array_t::empty()`
@note This function does not return whether a string stored as JSON value
@liveexample{The following code uses `empty()` to check if a JSON
is empty - it returns whether the JSON container itself is empty which is
object contains any elements.,empty}
false in the case of a string.
@complexity Constant, as long as @ref array_t and @ref object_t satisfy
@complexity Constant, as long as @ref array_t and @ref object_t satisfy
the Container concept; that is, their `empty()` functions have constant
the Container concept; that is, their `empty()` functions have constant
complexity.
complexity.
@iterators No changes.
@exceptionsafety No-throw guarantee: this function never throws exceptions.
@note This function does not return whether a string stored as JSON value
is empty - it returns whether the JSON container itself is empty which is
false in the case of a string.
@requirement This function helps `basic_json` satisfying the
@requirement This function helps `basic_json` satisfying the