This commit is contained in:
nlohmann
2026-10-03 05:43:12 +00:00
parent 2aaa1d24ef
commit a410b4f40f
741 changed files with 8115 additions and 2252 deletions
File diff suppressed because one or more lines are too long
+9 -2
View File
@@ -13,11 +13,11 @@ using json_serializer = JSONSerializer<T, SFINAE>;
## Notes
#### Default type
### Default type
The default values for `json_serializer` is [`adl_serializer`](https://json.nlohmann.me/api/adl_serializer/index.md).
#### Requirements
### Requirements
A custom serializer must provide `static void to_json(basic_json&, T)` for every type it serializes, and either `static void from_json(const basic_json&, T&)` or `static T from_json(const basic_json&)` for every type it deserializes. See [Template Parameter Requirements](https://json.nlohmann.me/features/types/template_parameters/#jsonserializer).
@@ -89,6 +89,13 @@ Output:
Ned Flanders (60) lives in 744 Evergreen Terrace
```
## See also
- [adl_serializer](https://json.nlohmann.me/api/adl_serializer/index.md) the default `json_serializer`
- [get](https://json.nlohmann.me/api/basic_json/get/index.md) explicit type conversion using the `json_serializer`'s `from_json()` method
- [get_to](https://json.nlohmann.me/api/basic_json/get_to/index.md) explicit type conversion into a variable using the `json_serializer`'s `from_json()` method
- [Arbitrary Type Conversions](https://json.nlohmann.me/features/arbitrary_types/index.md) - the article on converting between JSON values and arbitrary types
## Version history
- Since version 2.0.0.