Simplify module API (#4840)

* Simplify module API

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

* Forgot missing newline

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
2025-08-03 04:02:12 -04:00
committed by GitHub
parent efcf9efb4f
commit a3211ab3ca
2 changed files with 6 additions and 13 deletions

View File

@@ -25,6 +25,7 @@ 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:
- `nlohmann::adl_serializer`
- `nlohmann::basic_json`
- `nlohmann::json`

View File

@@ -5,18 +5,10 @@ module;
export module nlohmann.json;
export namespace nlohmann {
template <typename T = void, typename SFINAE = void>
using adl_serializer = ::nlohmann::adl_serializer<T, SFINAE>;
using basic_json = ::nlohmann::basic_json<>;
using json = ::nlohmann::json;
template <typename RefStringType>
using json_pointer = ::nlohmann::json_pointer<RefStringType>;
using ::nlohmann::adl_serializer;
using ::nlohmann::basic_json;
using ::nlohmann::json;
using ::nlohmann::json_pointer;
using ::nlohmann::ordered_json;
template <class Key, class T, class IgnoredLess, class Allocator>
using ordered_map = ::nlohmann::ordered_map<Key, T, IgnoredLess, Allocator>;
using ::nlohmann::ordered_map;
} // namespace nlohmann