1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

Consolidate documentation (#3071)

* 🔥 consolidate documentation
* ♻️ overwork std specializations
* 🚚 move images files to mkdocs
* ♻️ fix URLs
* 🔧 tweak MkDocs configuration
* 🔧 add namespaces
* 📝 document deprecations
* 📝 document documentation generation
* 🚸 improve search
* 🚸 add examples
* 🚧 start adding documentation for macros
* 📝 add note for https://github.com/nlohmann/json/issues/874#issuecomment-1001699139
* 📝 overwork example handling
* 📝 fix Markdown tables
This commit is contained in:
Niels Lohmann
2021-12-29 13:41:01 +01:00
committed by GitHub
parent 6d3115924c
commit 29cd970b94
392 changed files with 4827 additions and 12560 deletions

View File

@ -1,4 +1,4 @@
# basic_json::unflatten
# <small>nlohmann::basic_json::</small>unflatten
```cpp
basic_json unflatten() const;
@ -15,6 +15,10 @@ The function restores the arbitrary nesting of a JSON value that has been flatte
the original JSON from a flattened version
## Exception safety
Strong exception safety: if an exception occurs, the original value stays intact.
## Exceptions
The function can throw the following exceptions:
@ -22,10 +26,6 @@ The function can throw the following exceptions:
- Throws [`type_error.314`](../../home/exceptions.md#jsonexceptiontype_error314) if value is not an object
- Throws [`type_error.315`](../../home/exceptions.md#jsonexceptiontype_error315) if object values are not primitive
## Exception safety
Strong exception safety: if an exception occurs, the original value stays intact.
## Complexity
Linear in the size the JSON value.
@ -36,7 +36,7 @@ Empty objects and arrays are flattened by [`flatten()`](flatten.md) to `#!json n
their original type. Apart from this example, for a JSON value `j`, the following is always true:
`#!cpp j == j.flatten().unflatten()`.
## Example
## Examples
??? example
@ -52,6 +52,10 @@ their original type. Apart from this example, for a JSON value `j`, the followin
--8<-- "examples/unflatten.output"
```
## See also
- [flatten](flatten.md) the reverse function
## Version history
- Added in version 2.0.0.