Fix missing exports from json.cppm (#5137)

* Fix missing exports from `json.cppm`

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Update documentation to describe what symbols are exported

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Add mention of `std` symbols

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Add `json_literals` inline namespace to `using` statement

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Remove internals (`nlohmann::detail::*`) from module

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Omit internals (`nlohmann::detail::*`) from modules documentation

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Restore `nlohmann::detail` symbols with mention of the MSVC bug

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

---------

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
This commit is contained in:
Miko
2026-05-08 00:57:50 -04:00
committed by GitHub
parent 0b5010242c
commit a64fc21243
2 changed files with 49 additions and 21 deletions
+12 -2
View File
@@ -24,11 +24,21 @@ json data = json::parse(f);
```
## Modules do not export macros
It should be noted that as modules do not export macros, the `nlohmann.json` module will not export any macros, but rather only the following symbols:
It should be noted that as modules do not export macros, the `nlohmann.json` module will not export any macros.
## Exported symbols
Only the following symbols are exported from `nlohmann.json`:
- `nlohmann::adl_serializer`
- `nlohmann::basic_json`
- `nlohmann::json`
- `nlohmann::json_pointer`
- `nlohmann::ordered_map`
- `nlohmann::ordered_json`
- `nlohmann::ordered_map`
- `nlohmann::to_string`
- `nlohmann::literals::json_literals::operator""_json`
- `nlohmann::literals::json_literals::operator""_json_pointer`
The following specialisations of `std` symbols are also exported:
- `std::hash`
- `std::less`
- `std::swap`