mirror of
https://github.com/nlohmann/json.git
synced 2026-04-14 03:58:55 +00:00
Documentation change (#3672)
Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
This commit is contained in:
@@ -17,9 +17,26 @@ This function is usually called by the constructors of the [basic_json](../basic
|
||||
`val` (in)
|
||||
: value to read from
|
||||
|
||||
!!! note
|
||||
## Examples
|
||||
|
||||
This documentation page is a stub.
|
||||
??? example
|
||||
|
||||
The example below shows how a `to_json` function can be implemented for a user-defined type. This function is called
|
||||
by the `adl_serializer` when the constructor `basic_json(ns::person)` is called.
|
||||
|
||||
```cpp
|
||||
--8<-- "examples/to_json.cpp"
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
--8<-- "examples/to_json.output"
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [from_json](from_json.md)
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
Reference in New Issue
Block a user