|
1 | 1 | module; |
| 2 | +#include <cstddef> |
2 | 3 | #include <cstdint> |
3 | 4 | #include <tuple> |
| 5 | +#include <type_traits> |
4 | 6 |
|
5 | 7 | export module mcpplibs.primitives.primitive.impl; |
6 | 8 |
|
@@ -57,7 +59,9 @@ public: |
57 | 59 |
|
58 | 60 | constexpr explicit primitive(value_type v) noexcept : value_(v) {} |
59 | 61 | constexpr value_type &value() noexcept { return value_; } |
60 | | - [[nodiscard]] constexpr value_type const &value() const noexcept { return value_; } |
| 62 | + [[nodiscard]] constexpr value_type const &value() const noexcept { |
| 63 | + return value_; |
| 64 | + } |
61 | 65 | constexpr explicit operator value_type() const noexcept { return value_; } |
62 | 66 |
|
63 | 67 | [[nodiscard]] auto load() const noexcept -> value_type { |
@@ -101,44 +105,44 @@ private: |
101 | 105 | value_type value_; |
102 | 106 | }; |
103 | 107 |
|
104 | | - namespace types { |
105 | | - template <policy::policy_type... Policies> |
106 | | - using Bool = primitive<bool, Policies...>; |
107 | | - |
108 | | - template <policy::policy_type... Policies> |
109 | | - using UChar = primitive<unsigned char, Policies...>; |
110 | | - template <policy::policy_type... Policies> |
111 | | - using Char8 = primitive<char8_t, Policies...>; |
112 | | - template <policy::policy_type... Policies> |
113 | | - using Char16 = primitive<char16_t, Policies...>; |
114 | | - template <policy::policy_type... Policies> |
115 | | - using Char32 = primitive<char32_t, Policies...>; |
116 | | - template <policy::policy_type... Policies> |
117 | | - using WChar = primitive<wchar_t, Policies...>; |
118 | | - |
119 | | - template <policy::policy_type... Policies> |
120 | | - using U8 = primitive<std::uint8_t, Policies...>; |
121 | | - template <policy::policy_type... Policies> |
122 | | - using U16 = primitive<std::uint16_t, Policies...>; |
123 | | - template <policy::policy_type... Policies> |
124 | | - using U32 = primitive<std::uint32_t, Policies...>; |
125 | | - template <policy::policy_type... Policies> |
126 | | - using U64 = primitive<std::uint64_t, Policies...>; |
127 | | - template <policy::policy_type... Policies> |
128 | | - using I8 = primitive<std::int8_t, Policies...>; |
129 | | - template <policy::policy_type... Policies> |
130 | | - using I16 = primitive<std::int16_t, Policies...>; |
131 | | - template <policy::policy_type... Policies> |
132 | | - using I32 = primitive<std::int32_t, Policies...>; |
133 | | - template <policy::policy_type... Policies> |
134 | | - using I64 = primitive<std::int64_t, Policies...>; |
135 | | - |
136 | | - template <policy::policy_type... Policies> |
137 | | - using F32 = primitive<float, Policies...>; |
138 | | - template <policy::policy_type... Policies> |
139 | | - using F64 = primitive<double, Policies...>; |
140 | | - template <policy::policy_type... Policies> |
141 | | - using F80 = primitive<long double, Policies...>; |
142 | | - } |
| 108 | +namespace types { |
| 109 | +template <policy::policy_type... Policies> |
| 110 | +using Bool = primitive<bool, Policies...>; |
| 111 | + |
| 112 | +template <policy::policy_type... Policies> |
| 113 | +using UChar = primitive<unsigned char, Policies...>; |
| 114 | +template <policy::policy_type... Policies> |
| 115 | +using Char8 = primitive<char8_t, Policies...>; |
| 116 | +template <policy::policy_type... Policies> |
| 117 | +using Char16 = primitive<char16_t, Policies...>; |
| 118 | +template <policy::policy_type... Policies> |
| 119 | +using Char32 = primitive<char32_t, Policies...>; |
| 120 | +template <policy::policy_type... Policies> |
| 121 | +using WChar = primitive<wchar_t, Policies...>; |
| 122 | + |
| 123 | +template <policy::policy_type... Policies> |
| 124 | +using U8 = primitive<std::uint8_t, Policies...>; |
| 125 | +template <policy::policy_type... Policies> |
| 126 | +using U16 = primitive<std::uint16_t, Policies...>; |
| 127 | +template <policy::policy_type... Policies> |
| 128 | +using U32 = primitive<std::uint32_t, Policies...>; |
| 129 | +template <policy::policy_type... Policies> |
| 130 | +using U64 = primitive<std::uint64_t, Policies...>; |
| 131 | +template <policy::policy_type... Policies> |
| 132 | +using I8 = primitive<std::int8_t, Policies...>; |
| 133 | +template <policy::policy_type... Policies> |
| 134 | +using I16 = primitive<std::int16_t, Policies...>; |
| 135 | +template <policy::policy_type... Policies> |
| 136 | +using I32 = primitive<std::int32_t, Policies...>; |
| 137 | +template <policy::policy_type... Policies> |
| 138 | +using I64 = primitive<std::int64_t, Policies...>; |
| 139 | + |
| 140 | +template <policy::policy_type... Policies> |
| 141 | +using F32 = primitive<float, Policies...>; |
| 142 | +template <policy::policy_type... Policies> |
| 143 | +using F64 = primitive<double, Policies...>; |
| 144 | +template <policy::policy_type... Policies> |
| 145 | +using F80 = primitive<long double, Policies...>; |
| 146 | +} // namespace types |
143 | 147 |
|
144 | 148 | } // namespace mcpplibs::primitives |
0 commit comments