Skip to content

Commit a3211ab

Browse files
Simplify module API (#4840)
* Simplify module API Signed-off-by: Miko <[email protected]> * Forgot missing newline Signed-off-by: Miko <[email protected]> --------- Signed-off-by: Miko <[email protected]>
1 parent efcf9ef commit a3211ab

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

docs/mkdocs/docs/features/modules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ json data = json::parse(f);
2525
2626
## Modules do not export macros
2727
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:
28+
2829
- `nlohmann::adl_serializer`
2930
- `nlohmann::basic_json`
3031
- `nlohmann::json`

src/modules/json.cppm

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,10 @@ module;
55
export module nlohmann.json;
66

77
export namespace nlohmann {
8-
template <typename T = void, typename SFINAE = void>
9-
using adl_serializer = ::nlohmann::adl_serializer<T, SFINAE>;
10-
11-
using basic_json = ::nlohmann::basic_json<>;
12-
13-
using json = ::nlohmann::json;
14-
15-
template <typename RefStringType>
16-
using json_pointer = ::nlohmann::json_pointer<RefStringType>;
17-
8+
using ::nlohmann::adl_serializer;
9+
using ::nlohmann::basic_json;
10+
using ::nlohmann::json;
11+
using ::nlohmann::json_pointer;
1812
using ::nlohmann::ordered_json;
19-
20-
template <class Key, class T, class IgnoredLess, class Allocator>
21-
using ordered_map = ::nlohmann::ordered_map<Key, T, IgnoredLess, Allocator>;
13+
using ::nlohmann::ordered_map;
2214
} // namespace nlohmann

0 commit comments

Comments
 (0)