Skip to content

Commit 21f1bd7

Browse files
refactor: Using auto
1 parent 9e1674b commit 21f1bd7

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/traits/policy.cppm

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module;
2-
#include <type_traits>
32

43
export module mcpplibs.primitives.traits.policy;
54

@@ -10,7 +9,7 @@ enum class category { value, type, error, concurrency };
109
template <typename P> struct traits {
1110
using policy_type = void;
1211
static constexpr bool enabled = false;
13-
static constexpr category kind = static_cast<category>(-1);
12+
static constexpr auto kind = static_cast<category>(-1);
1413
};
1514

1615
struct checked_value {};
@@ -31,67 +30,67 @@ struct atomic {};
3130
template <> struct traits<checked_value> {
3231
using policy_type = checked_value;
3332
static constexpr bool enabled = true;
34-
static constexpr category kind = category::value;
33+
static constexpr auto kind = category::value;
3534
};
3635

3736
template <> struct traits<unchecked_value> {
3837
using policy_type = unchecked_value;
3938
static constexpr bool enabled = true;
40-
static constexpr category kind = category::value;
39+
static constexpr auto kind = category::value;
4140
};
4241

4342
template <> struct traits<saturating_value> {
4443
using policy_type = saturating_value;
4544
static constexpr bool enabled = true;
46-
static constexpr category kind = category::value;
45+
static constexpr auto kind = category::value;
4746
};
4847

4948
template <> struct traits<strict_type> {
5049
using policy_type = strict_type;
5150
static constexpr bool enabled = true;
52-
static constexpr category kind = category::type;
51+
static constexpr auto kind = category::type;
5352
};
5453

5554
template <> struct traits<category_compatible_type> {
5655
using policy_type = category_compatible_type;
5756
static constexpr bool enabled = true;
58-
static constexpr category kind = category::type;
57+
static constexpr auto kind = category::type;
5958
};
6059

6160
template <> struct traits<transparent_type> {
6261
using policy_type = transparent_type;
6362
static constexpr bool enabled = true;
64-
static constexpr category kind = category::type;
63+
static constexpr auto kind = category::type;
6564
};
6665

6766
template <> struct traits<throw_error> {
6867
using policy_type = throw_error;
6968
static constexpr bool enabled = true;
70-
static constexpr category kind = category::error;
69+
static constexpr auto kind = category::error;
7170
};
7271

7372
template <> struct traits<expected_error> {
7473
using policy_type = expected_error;
7574
static constexpr bool enabled = true;
76-
static constexpr category kind = category::error;
75+
static constexpr auto kind = category::error;
7776
};
7877

7978
template <> struct traits<terminate_error> {
8079
using policy_type = terminate_error;
8180
static constexpr bool enabled = true;
82-
static constexpr category kind = category::error;
81+
static constexpr auto kind = category::error;
8382
};
8483

8584
template <> struct traits<single_thread> {
8685
using policy_type = single_thread;
8786
static constexpr bool enabled = true;
88-
static constexpr category kind = category::concurrency;
87+
static constexpr auto kind = category::concurrency;
8988
};
9089

9190
template <> struct traits<atomic> {
9291
using policy_type = atomic;
9392
static constexpr bool enabled = true;
94-
static constexpr category kind = category::concurrency;
93+
static constexpr auto kind = category::concurrency;
9594
};
9695

9796
template <typename P>

0 commit comments

Comments
 (0)