This commit is contained in:
nlohmann committed 2026-10-27 12:14:00 +00:00
1 parent b36f8a9821
commit 11a863958e
1180 files changed
+14211 -6025

No files matched your search

+11
View File
@@ -4,6 +4,8 @@ This library has experimental support for C++ modules, introduced in C++20. The
Please be aware that the module is experimental and a full test is outstanding, and the exported symbols are subject to change.
Importing the module instead of including the header reduces the compile time of every translation unit that uses the library, at the price of building the module once. The [Compile times](../integration/compile_times.md#use-c20-modules) page has measurements and the one-off cost.
## Requirements
The `nlohmann.json` module requires that the build system is configured to build and resolve modules when imported. Obviously, as modules were introduced in C++20, this feature can only be used in C++20 and subsequent versions.
@@ -66,3 +68,12 @@ C++20 modules support is exercised in CI against current GCC and Clang on Ubuntu
- **MSVC** could fail with `C2039: 'json_sax_dom_callback_parser' is not a member of ... detail`; fixed by exporting the required internal symbols from `json.cppm` (see [Exported symbols](#exported-symbols) above). ([issue #3970](https://github.com/nlohmann/json/issues/3970))
If you hit a different module-related build failure, search [existing issues](https://github.com/nlohmann/json/issues?q=is%3Aissue+modules) before filing a new one.
## See also
- [Supported Macros](macros.md) - macros are not exported by modules
- [Macros](../api/macros/index.md) - reference of all macros
- [`nlohmann` Namespace](namespace.md) - the library namespace
- [CMake](../integration/cmake.md) - enable the module build in CMake
- [Compile times](../integration/compile_times.md) - reduce compile times
- [`basic_json`](../api/basic_json/index.md) - the main class and all its member functions