mirror of
https://github.com/nlohmann/json.git
synced 2026-07-27 21:04:55 +00:00
Add assertion if nullptr is passed to parse function (#3593)
Addresses #3584
This commit is contained in:
@@ -29,7 +29,7 @@ Unlike the [`parse`](parse.md) function, this function neither throws an excepti
|
||||
: A compatible input, for instance:
|
||||
|
||||
- an `std::istream` object
|
||||
- a `FILE` pointer
|
||||
- a `FILE` pointer (must not be null)
|
||||
- a C-style array of characters
|
||||
- a pointer to a null-terminated string of single byte characters
|
||||
- a `std::string`
|
||||
@@ -72,6 +72,11 @@ Linear in the length of the input. The parser is a predictive LL(1) parser.
|
||||
|
||||
(1) A UTF-8 byte order mark is silently ignored.
|
||||
|
||||
!!! danger "Runtime assertion"
|
||||
|
||||
The precondition that a passed `#!cpp FILE` pointer must not be null is enforced with a
|
||||
[runtime assertion](../../features/assertions.md).
|
||||
|
||||
## Examples
|
||||
|
||||
??? example
|
||||
|
||||
Reference in New Issue
Block a user