Skip to content

Commit 0ff65de

Browse files
refactor: Add type aliases
1 parent 628a8bc commit 0ff65de

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

src/primitive/impl.cppm

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module;
2+
#include <cstdint>
23
#include <tuple>
34

45
export module mcpplibs.primitives.primitive.impl;
@@ -21,4 +22,44 @@ private:
2122
value_type value_;
2223
};
2324

25+
namespace types {
26+
template <policy::policy_type... Policies>
27+
using Bool = primitive<bool, Policies...>;
28+
29+
template <policy::policy_type... Policies>
30+
using UChar = primitive<unsigned char, Policies...>;
31+
template <policy::policy_type... Policies>
32+
using Char8 = primitive<char8_t, Policies...>;
33+
template <policy::policy_type... Policies>
34+
using Char16 = primitive<char16_t, Policies...>;
35+
template <policy::policy_type... Policies>
36+
using Char32 = primitive<char32_t, Policies...>;
37+
template <policy::policy_type... Policies>
38+
using WChar = primitive<wchar_t, Policies...>;
39+
40+
template <policy::policy_type... Policies>
41+
using U8 = primitive<std::uint8_t, Policies...>;
42+
template <policy::policy_type... Policies>
43+
using U16 = primitive<std::uint16_t, Policies...>;
44+
template <policy::policy_type... Policies>
45+
using U32 = primitive<std::uint32_t, Policies...>;
46+
template <policy::policy_type... Policies>
47+
using U64 = primitive<std::uint64_t, Policies...>;
48+
template <policy::policy_type... Policies>
49+
using I8 = primitive<std::int8_t, Policies...>;
50+
template <policy::policy_type... Policies>
51+
using I16 = primitive<std::int16_t, Policies...>;
52+
template <policy::policy_type... Policies>
53+
using I32 = primitive<std::int32_t, Policies...>;
54+
template <policy::policy_type... Policies>
55+
using I64 = primitive<std::int64_t, Policies...>;
56+
57+
template <policy::policy_type... Policies>
58+
using F32 = primitive<float, Policies...>;
59+
template <policy::policy_type... Policies>
60+
using F64 = primitive<double, Policies...>;
61+
template <policy::policy_type... Policies>
62+
using F80 = primitive<long double, Policies...>;
63+
}
64+
2465
} // namespace mcpplibs::primitives

0 commit comments

Comments
 (0)