Skip to content

Commit d7aa281

Browse files
refactor: Move policy to a separate submodule
1 parent ebfcee9 commit d7aa281

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
module;
22

3-
export module mcpplibs.primitives.traits.policy;
3+
export module mcpplibs.primitives.policy.impl;
44

5-
export namespace mcpplibs::primitives::policy {
6-
7-
enum class category { value, type, error, concurrency };
5+
import mcpplibs.primitives.policy.traits;
86

9-
template <typename P> struct traits {
10-
using policy_type = void;
11-
static constexpr bool enabled = false;
12-
static constexpr auto kind = static_cast<category>(-1);
13-
};
7+
export namespace mcpplibs::primitives::policy {
148

159
struct checked_value {};
1610
struct unchecked_value {};

src/policy/policy.cppm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module;
2+
3+
export module mcpplibs.primitives.policy;
4+
5+
// Entry module for policy: export traits and impl submodules.
6+
export import mcpplibs.primitives.policy.traits;
7+
export import mcpplibs.primitives.policy.impl;

src/policy/traits.cppm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module;
2+
3+
export module mcpplibs.primitives.policy.traits;
4+
5+
// Primary template and category enum for policy traits. Concrete policy tags
6+
// and specializations live in the implementation submodule.
7+
8+
export namespace mcpplibs::primitives::policy {
9+
10+
enum class category { value, type, error, concurrency };
11+
12+
template <typename P> struct traits {
13+
using policy_type = void;
14+
static constexpr bool enabled = false;
15+
static constexpr auto kind = static_cast<category>(-1);
16+
};
17+
18+
} // namespace mcpplibs::primitives::policy

0 commit comments

Comments
 (0)