mirror of
https://github.com/nlohmann/json.git
synced 2026-03-26 10:52:50 +00:00
Overwork documentation (#3444)
* 📝 overwork macro documentation * 📝 address review comments * 🔧 add style check to Makefile * 🙈 overwork .gitignore * 📌 Pygments 2.12.0 is broken * ✏️ fix links * 🚸 adjust output to cppcheck * 📝 add titles to more admonitions * ✏️ fix typos * 📝 document future behavior change
This commit is contained in:
@@ -24,8 +24,8 @@ NLOHMANN_JSON_SERIALIZE_ENUM( TaskState, {
|
||||
})
|
||||
```
|
||||
|
||||
The `NLOHMANN_JSON_SERIALIZE_ENUM()` macro declares a set of `to_json()` / `from_json()` functions for type `TaskState`
|
||||
while avoiding repetition and boilerplate serialization code.
|
||||
The [`NLOHMANN_JSON_SERIALIZE_ENUM()` macro](../api/macros/nlohmann_json_serialize_enum.md) declares a set of
|
||||
`to_json()` / `from_json()` functions for type `TaskState` while avoiding repetition and boilerplate serialization code.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -45,10 +45,11 @@ assert(jPi.get<TaskState>() == TS_INVALID );
|
||||
|
||||
## Notes
|
||||
|
||||
Just as in [Arbitrary Type Conversions](#arbitrary-types-conversions) above,
|
||||
Just as in [Arbitrary Type Conversions](arbitrary_types.md) above,
|
||||
|
||||
- `NLOHMANN_JSON_SERIALIZE_ENUM()` MUST be declared in your enum type's namespace (which can be the global namespace),
|
||||
or the library will not be able to locate it, and it will default to integer serialization.
|
||||
- [`NLOHMANN_JSON_SERIALIZE_ENUM()`](../api/macros/nlohmann_json_serialize_enum.md) MUST be declared in your enum type's
|
||||
namespace (which can be the global namespace), or the library will not be able to locate it, and it will default to
|
||||
integer serialization.
|
||||
- It MUST be available (e.g., proper headers must be included) everywhere you use the conversions.
|
||||
|
||||
Other Important points:
|
||||
|
||||
Reference in New Issue
Block a user