CommonLibSSE NG
Loading...
Searching...
No Matches
TypeTraits.h
Go to the documentation of this file.
1#pragma once
2
5#include "RE/T/TypeInfo.h"
6
7namespace RE
8{
10 {};
11
12 namespace BSScript
13 {
14 template <class>
16 std::false_type
17 {};
18
19 template <class T>
21 reference_array<T>> :
22 std::true_type
23 {};
24
25 template <class T>
28 std::remove_cv_t<T>>
29 {};
30
31 template <class T>
33
34 template <class T>
36 std::negation<
37 is_reference_wrapper<T>>
38 {};
39
40 template <class T>
42
43 template <class T, class = void>
45 {
47 };
48
49 template <class T>
51 T,
52 std::enable_if_t<
53 std::disjunction_v<
54 is_array<T>,
55 is_reference_wrapper<T>>>>
56 {
58 };
59
60 template <class T>
63 std::remove_cv_t<T>>
64 {};
65
66 template <class T>
68
69 template <TypeInfo::RawType V>
71 std::integral_constant<
72 TypeInfo::RawType, V>
73 {};
74
75 template <class, class = void>
76 struct _vm_type;
77
78 template <>
79 struct _vm_type<void> :
81 TypeInfo::RawType::kNone>
82 {};
83
84 template <class T>
85 struct _vm_type<
86 T,
87 std::enable_if_t<
88 is_string_convertible_v<T>>> :
90 TypeInfo::RawType::kString>
91 {};
92
93 template <class T>
94 struct _vm_type<
95 T,
96 std::enable_if_t<
97 is_integral_convertible_v<T>>> :
99 TypeInfo::RawType::kInt>
100 {};
101
102 template <class T>
103 struct _vm_type<
104 T,
105 std::enable_if_t<
106 is_floating_point_convertible_v<T>>> :
108 TypeInfo::RawType::kFloat>
109 {};
110
111 template <class T>
112 struct _vm_type<
113 T,
114 std::enable_if_t<
115 is_boolean_v<T>>> :
117 TypeInfo::RawType::kBool>
118 {};
119
120 template <class T>
121 struct vm_type :
122 _vm_type<
123 unwrapped_type_t<T>>
124 {};
125
126 template <class T>
128
129 template <class T>
131 std::is_same<
132 decay_pointer_t<T>,
133 StaticFunctionTag>
134 {};
135
136 template <class T>
138
139 template <class T>
141 std::conjunction<
142 is_static_base<T>,
143 std::is_pointer<T>>
144 {};
145
146 template <class T>
148
149 template <class T>
151 std::disjunction<
152 is_static_base_pointer<T>,
153 is_form_pointer<T>,
154 is_alias_pointer<T>,
155 is_active_effect_pointer<T>>
156 {};
157
158 template <class T>
160
161 template <class T>
163 std::conjunction<
164 is_not_reference<T>,
165 is_not_volatile<T>,
166 std::disjunction<
167 is_builtin<T>,
168 is_form_pointer<T>,
169 is_alias_pointer<T>,
170 is_active_effect_pointer<T>,
171 is_array<T>,
172 is_reference_wrapper<T>>>
173 {};
174
175 template <class T>
177
178 template <class T>
180 std::conjunction<
181 is_not_reference<T>,
182 is_not_volatile<T>,
183 std::disjunction<
184 is_builtin_convertible<T>,
185 is_form_pointer<T>,
186 is_alias_pointer<T>,
187 is_active_effect_pointer<T>,
188 is_array<T>,
189 is_reference_wrapper<T>>>
190 {};
191
192 template <class T>
194
195 template <class T>
197 std::conjunction<
198 is_not_const<T>,
199 is_not_reference_wrapper<T>,
200 is_valid_parameter<T>>
201 {};
202
203 template <class T>
205
206 template <class T>
208 std::conjunction<
209 is_not_const<T>,
210 is_not_reference_wrapper<T>,
211 is_parameter_convertible<T>>
212 {};
213
214 template <class T>
216
217 template <class R, class Cls, class... Args>
219 std::conjunction<
220 is_return_convertible<R>,
221 is_valid_base<Cls>,
222 is_parameter_convertible<Args>...>
223 {};
224
225 template <class R, class Cls, class... Args>
226 inline constexpr bool is_valid_short_sig_v = is_valid_short_sig<R, Cls, Args...>::value;
227
228 template <class Int, class R, class Cls, class... Args>
230 std::conjunction<
231 is_integral<Int>,
232 is_valid_short_sig<R, Cls, Args...>>
233 {};
234
235 template <class R, class Int, class F, class Cls, class... Args>
237 std::conjunction<
238 is_return_convertible<R>,
239 is_integral<Int>,
240 std::bool_constant<sizeof(F) == 1>,
241 std::is_enum<F>,
242 is_valid_short_sig<F, Cls, Args...>>
243 {};
244
245 template <class Int, class R, class Cls, class... Args>
246 inline constexpr bool is_valid_long_sig_v = is_valid_long_sig<Int, R, Cls, Args...>::value;
247
248 template <class R, class Int, class F, class Cls, class... Args>
249 inline constexpr bool is_valid_latent_long_sig_v = is_valid_latent_long_sig<R, Int, F, Cls, Args...>::value;
250 }
251}
RawType
Definition TypeInfo.h:13
Definition ReferenceArray.h:13
constexpr bool is_valid_parameter_v
Definition TypeTraits.h:176
constexpr TypeInfo::RawType vm_type_v
Definition TypeTraits.h:127
constexpr bool is_static_base_v
Definition TypeTraits.h:137
typename decay_pointer< T >::type decay_pointer_t
Definition CommonTypeTraits.h:200
constexpr bool is_valid_latent_long_sig_v
Definition TypeTraits.h:249
constexpr bool is_valid_long_sig_v
Definition TypeTraits.h:246
typename unwrapped_type< T >::type unwrapped_type_t
Definition TypeTraits.h:67
constexpr bool is_valid_short_sig_v
Definition TypeTraits.h:226
constexpr bool is_parameter_convertible_v
Definition TypeTraits.h:193
constexpr bool is_valid_base_v
Definition TypeTraits.h:159
constexpr bool is_valid_return_v
Definition TypeTraits.h:204
constexpr bool is_not_reference_wrapper_v
Definition TypeTraits.h:41
constexpr bool is_return_convertible_v
Definition TypeTraits.h:215
constexpr bool is_reference_wrapper_v
Definition TypeTraits.h:32
constexpr bool is_static_base_pointer_v
Definition TypeTraits.h:147
Definition AbsorbEffect.h:6
Definition ActorValueList.h:28
Definition TypeTraits.h:17
Definition TypeTraits.h:45
decay_pointer_t< T > type
Definition TypeTraits.h:46
Definition TypeTraits.h:76
Definition TypeTraits.h:38
Definition TypeTraits.h:190
Definition TypeTraits.h:29
Definition TypeTraits.h:212
Definition TypeTraits.h:144
Definition TypeTraits.h:134
Definition TypeTraits.h:156
Definition TypeTraits.h:243
Definition TypeTraits.h:233
Definition TypeTraits.h:173
Definition TypeTraits.h:201
Definition TypeTraits.h:223
Definition TypeTraits.h:64
Definition TypeTraits.h:73
Definition TypeTraits.h:124
Definition TypeTraits.h:10