1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-29 23:01:16 +03:00

Adjust JSON Pointer examples (#3622)

* 📝 adjust JSON Pointer examples

* 👷 add test for documentation

* 📝 note platform-dependent output on some examples
This commit is contained in:
Niels Lohmann
2022-07-29 14:28:37 +02:00
committed by GitHub
parent 6576c3f776
commit d1d79b930d
18 changed files with 86 additions and 56 deletions

View File

@ -317,6 +317,8 @@ basic_json(basic_json&& other) noexcept;
--8<-- "examples/basic_json__CompatibleType.output"
```
Note the output is platform-dependent.
??? example "Example: (5) create a container (array or object) from an initializer list"
The example below shows how JSON values are created from initializer lists.

View File

@ -40,7 +40,7 @@ string elements the JSON value can store which is `1`.
??? example
The following code calls `max_size()` on the different value types. Note the output is implementation specific.
The following code calls `max_size()` on the different value types.
```cpp
--8<-- "examples/max_size.cpp"
@ -52,6 +52,8 @@ string elements the JSON value can store which is `1`.
--8<-- "examples/max_size.output"
```
Note the output is platform-dependent.
## Version history
- Added in version 1.0.0.

View File

@ -32,8 +32,7 @@ Constant.
??? example
The following code shows an example output of the `meta()`
function.
The following code shows an example output of the `meta()` function.
```cpp
--8<-- "examples/meta.cpp"
@ -45,6 +44,8 @@ Constant.
--8<-- "examples/meta.output"
```
Note the output is platform-dependent.
## See also
- [**NLOHMANN_JSON_VERSION_MAJOR**/**NLOHMANN_JSON_VERSION_MINOR**/**NLOHMANN_JSON_VERSION_PATCH**](../macros/nlohmann_json_version_major.md) - library version information

View File

@ -26,6 +26,8 @@ type of the JSON value is taken into account to have different hash values for `
--8<-- "examples/std_hash.output"
```
Note the output is platform-dependent.
## Version history
- Added in version 1.0.0.