diff --git a/docs/mkdocs/docs/api/basic_json/meta.md b/docs/mkdocs/docs/api/basic_json/meta.md
index 34d35ba8e..c584f9b6d 100644
--- a/docs/mkdocs/docs/api/basic_json/meta.md
+++ b/docs/mkdocs/docs/api/basic_json/meta.md
@@ -48,7 +48,8 @@ Constant.
## See also
-- [**NLOHMANN_JSON_VERSION_MAJOR**/**NLOHMANN_JSON_VERSION_MINOR**/**NLOHMANN_JSON_VERSION_PATCH**](../macros/nlohmann_json_version_major.md) - library version information
+- [**NLOHMANN_JSON_VERSION_MAJOR**/**NLOHMANN_JSON_VERSION_MINOR**/**NLOHMANN_JSON_VERSION_PATCH**](../macros/nlohmann_json_version_major.md)
+ \- library version information
## Version history
diff --git a/docs/mkdocs/docs/api/macros/index.md b/docs/mkdocs/docs/api/macros/index.md
index 06a65cb4d..13accd797 100644
--- a/docs/mkdocs/docs/api/macros/index.md
+++ b/docs/mkdocs/docs/api/macros/index.md
@@ -25,7 +25,8 @@ header. See also the [macro overview page](../../features/macros.md).
## Library version
- [**JSON_SKIP_LIBRARY_VERSION_CHECK**](json_skip_library_version_check.md) - skip library version check
-- [**NLOHMANN_JSON_VERSION_MAJOR**
**NLOHMANN_JSON_VERSION_MINOR**
**NLOHMANN_JSON_VERSION_PATCH**](nlohmann_json_version_major.md) - library version information
+- [**NLOHMANN_JSON_VERSION_MAJOR**
**NLOHMANN_JSON_VERSION_MINOR**
**NLOHMANN_JSON_VERSION_PATCH**](nlohmann_json_version_major.md)
+ \- library version information
## Library namespace
@@ -45,7 +46,11 @@ header. See also the [macro overview page](../../features/macros.md).
## Serialization/deserialization macros
-- [**NLOHMANN_DEFINE_TYPE_INTRUSIVE(type, member...)**
**NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(type, member...)**](nlohmann_define_type_intrusive.md) - serialization/deserialization of types _with_ access to private variables
-- [**NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(type, member...)**
**NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(type, member...)**](nlohmann_define_type_non_intrusive.md) - serialization/deserialization of types _without_ access to private variables
-- [**NLOHMANN_JSON_SERIALIZE_ENUM(type, ...)**](nlohmann_json_serialize_enum.md) - serialization/deserialization of enum
- types
+- [**NLOHMANN_DEFINE_TYPE_INTRUSIVE(type, member...)**
**NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(type, member...)**][DefInt]
+ \- serialization/deserialization of types _with_ access to private variables
+- [**NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(type, member...)**
**NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(type, member...)**][DefNonInt]
+ \- serialization/deserialization of types _without_ access to private variables
+- [**NLOHMANN_JSON_SERIALIZE_ENUM(type, ...)**](nlohmann_json_serialize_enum.md) - serialization/deserialization of enum types
+
+[DefInt]: nlohmann_define_type_intrusive.md
+[DefNonInt]: nlohmann_define_type_non_intrusive.md
diff --git a/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md b/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md
index 0c4d13608..2bb4a724b 100644
--- a/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md
+++ b/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md
@@ -4,7 +4,8 @@
#define JSON_DISABLE_ENUM_SERIALIZATION
```
-When defined, default serialization and deserialization functions for enums are excluded and have to be provided by the user, for example, using [`NLOHMANN_JSON_SERIALIZE_ENUM`](nlohmann_json_serialize_enum.md) (see [arbitrary type conversions](../../features/arbitrary_types.md) for more details).
+When defined, default serialization and deserialization functions for enums are excluded and have to be provided by the user, for example, using
+[`NLOHMANN_JSON_SERIALIZE_ENUM`](nlohmann_json_serialize_enum.md) (see [arbitrary type conversions](../../features/arbitrary_types.md) for more details).
Parsing or serializing an enum will result in a compiler error.
@@ -22,7 +23,8 @@ By default, `#!cpp JSON_DISABLE_ENUM_SERIALIZATION` is not defined.
??? example "Example 1: Disabled behavior"
- The code below forces the library **not** to create default serialization/deserialization functions `from_json` and `to_json`, meaning the code below **does not** compile.
+ The code below forces the library **not** to create default serialization/deserialization functions `from_json` and `to_json`, meaning the code below
+ **does not** compile.
```cpp
#define JSON_DISABLE_ENUM_SERIALIZATION 1
@@ -48,7 +50,8 @@ By default, `#!cpp JSON_DISABLE_ENUM_SERIALIZATION` is not defined.
??? example "Example 2: Serialize enum macro"
- The code below forces the library **not** to create default serialization/deserialization functions `from_json` and `to_json`, but uses [`NLOHMANN_JSON_SERIALIZE_ENUM`](nlohmann_json_serialize_enum.md) to parse and serialize the enum.
+ The code below forces the library **not** to create default serialization/deserialization functions `from_json` and `to_json`, but uses
+ [`NLOHMANN_JSON_SERIALIZE_ENUM`](nlohmann_json_serialize_enum.md) to parse and serialize the enum.
```cpp
#define JSON_DISABLE_ENUM_SERIALIZATION 1
@@ -80,7 +83,8 @@ By default, `#!cpp JSON_DISABLE_ENUM_SERIALIZATION` is not defined.
??? example "Example 3: User-defined serialization/deserialization functions"
- The code below forces the library **not** to create default serialization/deserialization functions `from_json` and `to_json`, but uses user-defined functions to parse and serialize the enum.
+ The code below forces the library **not** to create default serialization/deserialization functions `from_json` and `to_json`, but uses user-defined
+ functions to parse and serialize the enum.
```cpp
#define JSON_DISABLE_ENUM_SERIALIZATION 1
diff --git a/docs/mkdocs/docs/api/macros/json_has_ranges.md b/docs/mkdocs/docs/api/macros/json_has_ranges.md
index ae596979e..96d51052d 100644
--- a/docs/mkdocs/docs/api/macros/json_has_ranges.md
+++ b/docs/mkdocs/docs/api/macros/json_has_ranges.md
@@ -13,6 +13,19 @@ The default value is detected based on the preprocessor macro `#!cpp __cpp_lib_r
When the macro is not defined, the library will define it to its default value.
+## Examples
+
+??? example
+
+ The code below forces the library to enable support for ranges:
+
+ ```cpp
+ #define JSON_HAS_RANGES 1
+ #include
+
+ ...
+ ```
+
## Version history
- Added in version 3.11.0.
diff --git a/docs/mkdocs/docs/api/macros/json_has_three_way_comparison.md b/docs/mkdocs/docs/api/macros/json_has_three_way_comparison.md
index fc1dcb43c..f52070ebf 100644
--- a/docs/mkdocs/docs/api/macros/json_has_three_way_comparison.md
+++ b/docs/mkdocs/docs/api/macros/json_has_three_way_comparison.md
@@ -14,6 +14,19 @@ and `#!cpp __cpp_lib_three_way_comparison`.
When the macro is not defined, the library will define it to its default value.
+## Examples
+
+??? example
+
+ The code below forces the library to use 3-way comparison:
+
+ ```cpp
+ #define JSON_HAS_THREE_WAY_COMPARISON 1
+ #include
+
+ ...
+ ```
+
## Version history
- Added in version 3.11.0.
diff --git a/docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md b/docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md
index 4f630db12..072c044b3 100644
--- a/docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md
+++ b/docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md
@@ -56,6 +56,19 @@ When the macro is not defined, the library will define it to its default value.
New code should not depend on it and existing code should try to remove or rewrite
expressions relying on it.
+## Examples
+
+??? example
+
+ The code below switches on the legacy discarded value comparison behavior in the library.
+
+ ```cpp
+ #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 1
+ #include
+
+ ...
+ ```
+
## Version history
- Added in version 3.11.0.
diff --git a/docs/mkdocs/docs/api/macros/nlohmann_define_type_intrusive.md b/docs/mkdocs/docs/api/macros/nlohmann_define_type_intrusive.md
index 7269ef081..ae0ee074c 100644
--- a/docs/mkdocs/docs/api/macros/nlohmann_define_type_intrusive.md
+++ b/docs/mkdocs/docs/api/macros/nlohmann_define_type_intrusive.md
@@ -40,10 +40,12 @@ See examples below for the concrete generated code.
!!! info "Prerequisites"
- 1. The type `type` must be default constructible. See [How can I use `get()` for non-default constructible/non-copyable types?](../../features/arbitrary_types.md#how-can-i-use-get-for-non-default-constructiblenon-copyable-types)
+ 1. The type `type` must be default constructible. See [How can I use `get()` for non-default constructible/non-copyable types?][GetNonDefNonCopy]
for how to overcome this limitation.
2. The macro must be used inside the type (class/struct).
+[GetNonDefNonCopy]: ../../features/arbitrary_types.md#how-can-i-use-get-for-non-default-constructiblenon-copyable-types
+
!!! warning "Implementation limits"
- The current implementation is limited to at most 64 member variables. If you want to serialize/deserialize types
diff --git a/docs/mkdocs/docs/api/macros/nlohmann_define_type_non_intrusive.md b/docs/mkdocs/docs/api/macros/nlohmann_define_type_non_intrusive.md
index 7ed5a6b43..be291f22f 100644
--- a/docs/mkdocs/docs/api/macros/nlohmann_define_type_non_intrusive.md
+++ b/docs/mkdocs/docs/api/macros/nlohmann_define_type_non_intrusive.md
@@ -40,11 +40,13 @@ See examples below for the concrete generated code.
!!! info "Prerequisites"
- 1. The type `type` must be default constructible. See [How can I use `get()` for non-default constructible/non-copyable types?](../../features/arbitrary_types.md#how-can-i-use-get-for-non-default-constructiblenon-copyable-types)
+ 1. The type `type` must be default constructible. See [How can I use `get()` for non-default constructible/non-copyable types?][GetNonDefNonCopy]
for how to overcome this limitation.
2. The macro must be used outside the type (class/struct).
3. The passed members must be public.
+[GetNonDefNonCopy]: ../../features/arbitrary_types.md#how-can-i-use-get-for-non-default-constructiblenon-copyable-types
+
!!! warning "Implementation limits"
- The current implementation is limited to at most 64 member variables. If you want to serialize/deserialize types