2
3
4
5
6
7
8
11#ifndef _MSTD_MANAGEMENT_TYPES_HPP_
12 #define _MSTD_MANAGEMENT_TYPES_HPP_
14 #include <mstd/config.hpp>
17_MSTD_WARNING(
"this is only available for c++17 and greater!");
20 #include <mstd/management_utils.hpp>
23 #pragma region ARE_ALL
24 template<
template<
class>
class Test,
class...
Ts>
28 #pragma region INDEX_SEQUENCE_FROM_TO
30 template<size_t Start, size_t... Indices>
35 template<size_t Start, size_t End>
38 template<size_t Start, size_t Size>
41 template<size_t Start,
class... Ts>
45 #pragma region UNIVERSAL_CHECKS
47 template<
template<
class>
class Check,
class... Ts>
48 struct all_check : std::bool_constant<(Check<Ts>::value && ...)> {};
49 template<
template<
class>
class Check,
class...
Ts>
52 template<
template<
class>
class Check,
class... Ts>
53 struct any_check : std::bool_constant<(Check<Ts>::value || ...)> {};
54 template<
template<
class>
class Check,
class...
Ts>
58 #pragma region NUMERIC_TYPES
101 template<
class... Ns>
103 template<
class...
Ns>
117 #pragma region COMPARE_ARITHMETIC
121 struct abs_impl : std::conditional_t<std::is_unsigned_v<
decltype(A)>, std::integral_constant<
decltype(A), A>,
122 std::integral_constant<
decltype(A), (A > 0 ? A : -A)> > {};
134 template<
auto A,
auto B,
class AT =
decltype(A),
class BT =
decltype(B),
135 std::enable_if_t<(std::is_arithmetic_v<AT> && std::is_arithmetic_v<BT>),
bool> =
true>
144 template<
auto A,
auto B,
class AT =
decltype(A),
class BT =
decltype(B),
145 std::enable_if_t<(std::is_arithmetic_v<AT> && std::is_arithmetic_v<BT>),
bool> =
true>
151 #pragma region LOGIC_EXPRESIONS
153 template<
auto A,
auto B>
154 struct is_eq : std::bool_constant<(A == B)> {};
156 template<
auto A,
auto B>
159 template<
auto A,
auto B>
160 struct is_neq : std::bool_constant<(A != B)> {};
162 template<
auto A,
auto B>
165 template<
auto A,
auto B>
166 struct is_gt : std::bool_constant<(A > B)> {};
168 template<
auto A,
auto B>
171 template<
auto A,
auto B>
172 struct is_gteq : std::bool_constant<(A >= B)> {};
174 template<
auto A,
auto B>
177 template<
auto A,
auto B>
178 struct is_lt : std::bool_constant<(A < B)> {};
180 template<
auto A,
auto B>
183 template<
auto A,
auto B>
184 struct is_lteq : std::bool_constant<(A <= B)> {};
186 template<
auto A,
auto B>
191 template<
template<
class,
class>
class Cmp,
class T,
class U,
class...
Us>
194 template<
template<
auto,
auto>
class Cmp,
auto A,
auto B,
auto...
Cs>
197 template<
class T,
class U,
class...
Us>
199 template<
auto A,
auto B,
auto...
Cs>
203 #pragma region IN_RANGE
204 template<
auto A,
auto Min,
auto Max>
208 #pragma region IS_BASED_ON
209 template<
class T,
template<
class...>
class U>
211 template<
template<
class...>
class U,
class...
Vs>
215 #pragma region UNIQUE_TYPES
217 template<
class... Ts>
224 template<
class T,
class U>
227 template<
class T,
class... Us>
230 template<
class... Ts,
class T,
class... Us>
235 template<
class... Ts>
241 template<
class... Ts>
248 template<
bool Condition,
auto TrueValue,
auto FalseValue>
253 template<
auto TrueValue,
auto FalseValue>
263 #pragma region ID_MANAGER
267 template<
class IdT, std::enable_if_t<
mstd::is_unsigned_integral_v<IdT>,
bool> =
true>
269 class base_id_manager;
282 template<
class BitsEnum, std::enable_if_t<std::is_enum_v<BitsEnum>,
bool> =
true>
#define _MSTD_HAS_CXX17
Definition config.hpp:45
#define _MSTD_CONSTEXPR17
Definition config.hpp:76
#define _MSTD_HAS_CXX20
Definition config.hpp:52
#define _MSTD_REQUIRES(condition)
Definition config.hpp:86
#define _MSTD_TYPENAME17
Definition config.hpp:82
#define _MSTD_CONSTEXPR20
Definition config.hpp:84
Definition function_traits.hpp:23
Definition arithmetic_types.hpp:23
constexpr bool is_signed_integral_v
Definition management_types.hpp:61
static _MSTD_CONSTEXPR17 const bool are_all_v
Definition management_types.hpp:25
constexpr bool are_arithmetic_v
Definition management_types.hpp:74
constexpr bool any_check_v
Definition management_types.hpp:55
_MSTD_CONSTEXPR17 const bool is_neq_v
Definition management_types.hpp:163
_MSTD_CONSTEXPR17 const bool is_gt_v
Definition management_types.hpp:169
_MSTD_CONSTEXPR17 const bool is_lteq_v
Definition management_types.hpp:187
constexpr bool are_unsigned_integrals_v
Definition management_types.hpp:104
constexpr bool is_unsigned_integral_v
Definition management_types.hpp:66
_MSTD_CONSTEXPR17 const bool is_eq_value_in_v
Definition management_types.hpp:200
_MSTD_CONSTEXPR17 const bool is_based_on_v
Definition management_types.hpp:210
_MSTD_CONSTEXPR17 const bool is_type_in_v
Definition management_types.hpp:192
constexpr bool are_unsigned_v
Definition management_types.hpp:84
_MSTD_CONSTEXPR17 const bool is_same_type_in_v
Definition management_types.hpp:198
decltype(shift_index_sequence< Start >(std::make_index_sequence< Size >())) make_index_sequence_from
Definition management_types.hpp:39
constexpr bool are_signed_integrals_v
Definition management_types.hpp:99
_MSTD_CONSTEXPR17 const bool is_eq_v
Definition management_types.hpp:157
_MSTD_CONSTEXPR20 std::index_sequence<(Start+Indices)... > shift_index_sequence(const std::index_sequence< Indices... > &)
Definition management_types.hpp:31
_MSTD_CONSTEXPR17 const bool is_value_in_v
Definition management_types.hpp:195
decltype(shift_index_sequence< Start >(std::index_sequence_for< Ts... >())) make_index_sequence_for_from
Definition management_types.hpp:42
_MSTD_CONSTEXPR17 const bool is_gteq_v
Definition management_types.hpp:175
_MSTD_CONSTEXPR17 const bool is_in_range_v
Definition management_types.hpp:205
constexpr bool are_integrals_v
Definition management_types.hpp:94
constexpr bool are_signed_v
Definition management_types.hpp:79
static _MSTD_CONSTEXPR17 const auto if_v
Definition management_types.hpp:260
constexpr bool are_floating_points_v
Definition management_types.hpp:89
_MSTD_TYPENAME17 utils::unique_impl< types_holder<>, types_holder< Ts... > >::type unique_types
Definition management_types.hpp:242
base_id_manager< uint64_t > id64_manager
Definition management_types.hpp:275
constexpr bool all_check_v
Definition management_types.hpp:50
base_id_manager< size_t > id_manager
Definition management_types.hpp:271
_MSTD_CONSTEXPR17 const bool is_based_on_v< U< Vs... >, U >
Definition management_types.hpp:212
base_id_manager< uint16_t > id16_manager
Definition management_types.hpp:273
static _MSTD_CONSTEXPR17 const auto abs_v
Definition management_types.hpp:126
decltype(shift_index_sequence< Start >(std::make_index_sequence< End - Start >())) make_index_sequence_from_to
Definition management_types.hpp:36
base_id_manager< uint8_t > id8_manager
Definition management_types.hpp:272
_MSTD_CONSTEXPR17 const bool is_lt_v
Definition management_types.hpp:181
base_id_manager< uint32_t > id32_manager
Definition management_types.hpp:274
Definition management_types.hpp:48
Definition management_types.hpp:53
Definition management_types.hpp:72
Definition management_types.hpp:87
Definition management_types.hpp:92
Definition management_types.hpp:97
Definition management_types.hpp:77
Definition management_types.hpp:102
Definition management_types.hpp:82
Definition management_types.hpp:154
Definition management_types.hpp:166
Definition management_types.hpp:172
Definition management_types.hpp:178
Definition management_types.hpp:184
Definition management_types.hpp:160
Definition management_types.hpp:64
Definition management_types.hpp:69
Definition management_types.hpp:218
static _MSTD_CONSTEXPR17 const size_t types_num
Definition management_types.hpp:220
std::tuple< Ts... > as_tuple
Definition management_types.hpp:219
Definition management_types.hpp:122
Definition management_types.hpp:254
static _MSTD_CONSTEXPR17 const auto value
Definition management_types.hpp:255
Definition management_types.hpp:249
static _MSTD_CONSTEXPR17 const auto value
Definition management_types.hpp:250
Definition management_types.hpp:233
Definition management_types.hpp:236
types_holder< Ts... > type
Definition management_types.hpp:237
Definition management_types.hpp:228
Definition management_types.hpp:225