This commit is contained in:
nlohmann
2026-07-11 13:21:47 +00:00
parent 0a9a593da9
commit 483310ef04
269 changed files with 427 additions and 347 deletions
File diff suppressed because one or more lines are too long
+7 -4
View File
@@ -7,8 +7,8 @@ static basic_json from_bson(InputType&& i,
const bool strict = true,
const bool allow_exceptions = true);
// (2)
template<typename IteratorType>
static basic_json from_bson(IteratorType first, IteratorType last,
template<typename IteratorType, typename SentinelType = IteratorType>
static basic_json from_bson(IteratorType first, SentinelType last,
const bool strict = true,
const bool allow_exceptions = true);
```
@@ -16,7 +16,7 @@ static basic_json from_bson(IteratorType first, IteratorType last,
Deserializes a given input to a JSON value using the BSON (Binary JSON) serialization format.
1. Reads from a compatible input.
1. Reads from an iterator range.
1. Reads from an iterator range, or an iterator and a sentinel of a different type (C++20 ranges support).
The exact mapping and its limitations are described on a [dedicated page](https://json.nlohmann.me/features/binary_formats/bson/index.md).
@@ -35,13 +35,15 @@ The exact mapping and its limitations are described on a [dedicated page](https:
`IteratorType` : a compatible iterator type
`SentinelType` : defaults to `IteratorType`; may be a different type comparable to `IteratorType` via `operator!=`, for instance a custom sentinel type for C++20 ranges
## Parameters
`i` (in) : an input in BSON format convertible to an input adapter
`first` (in) : iterator to the start of the input
`last` (in) : iterator to the end of the input
`last` (in) : iterator to the end of the input, or a sentinel value that compares equal to the end iterator with `operator!=`
`strict` (in) : whether to expect the input to be consumed until EOF (`true` by default)
@@ -117,6 +119,7 @@ Output:
- Added in version 3.4.0.
- Extended container support (1) to include types with lvalue-only ADL `begin`/`end` (matching `std::begin`/`std::end` semantics) in version 3.13.0.
- Extended overload (2) to accept heterogeneous iterator+sentinel pairs (C++20 ranges support) in version 3.13.0.
Deprecation