mirror of
https://github.com/nlohmann/json.git
synced 2026-03-12 12:11:25 +00:00
Allow disabling default enum conversions (#3536)
This commit is contained in:
@@ -58,3 +58,4 @@ Other Important points:
|
||||
default pair carefully.
|
||||
- If an enum or JSON value is specified more than once in your map, the first matching occurrence from the top of the
|
||||
map will be returned when converting to or from JSON.
|
||||
- To disable the default serialization of enumerators as integers and force a compiler error instead, see [`JSON_DISABLE_ENUM_SERIALIZATION`](../api/macros/json_disable_enum_serialization.md).
|
||||
|
||||
@@ -54,6 +54,12 @@ Exceptions can be switched off by defining the symbol `JSON_NOEXCEPTION`.
|
||||
|
||||
See [full documentation of `JSON_NOEXCEPTION`](../api/macros/json_noexception.md).
|
||||
|
||||
## `JSON_DISABLE_ENUM_SERIALIZATION`
|
||||
|
||||
When defined, default parse and serialize functions for enums are excluded and have to be provided by the user, for example, using [`NLOHMANN_JSON_SERIALIZE_ENUM`](../api/macros/nlohmann_json_serialize_enum.md).
|
||||
|
||||
See [full documentation of `JSON_DISABLE_ENUM_SERIALIZATION`](../api/macros/json_disable_enum_serialization.md).
|
||||
|
||||
## `JSON_NO_IO`
|
||||
|
||||
When defined, headers `<cstdio>`, `<ios>`, `<iosfwd>`, `<istream>`, and `<ostream>` are not included and parse functions
|
||||
|
||||
Reference in New Issue
Block a user