CommonLibSSE (Parapets fork)
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 struct LatentPromiseBase;
15
16 template <class>
18 std::false_type
19 {};
20
21 template <class T>
23 reference_array<T>> :
24 std::true_type
25 {};
26
27 template <class T>
30 std::remove_cv_t<T>>
31 {};
32
33 template <class T>
35
36 template <class T>
38 std::negation<
39 is_reference_wrapper<T>>
40 {};
41
42 template <class T>
44
45 template <class T, class = void>
47 {
49 };
50
51 template <class T>
53 T,
54 std::enable_if_t<
55 std::disjunction_v<
56 is_array<T>,
57 is_reference_wrapper<T>>>>
58 {
60 };
61
62 template <class T>
65 std::remove_cv_t<T>>
66 {};
67
68 template <class T>
70
71 template <TypeInfo::RawType V>
73 std::integral_constant<
74 TypeInfo::RawType, V>
75 {};
76
77 template <class, class = void>
78 struct _vm_type;
79
80 template <>
81 struct _vm_type<void> :
83 TypeInfo::RawType::kNone>
84 {};
85
86 template <class T>
87 struct _vm_type<
88 T,
89 std::enable_if_t<
90 is_string_convertible_v<T>>> :
92 TypeInfo::RawType::kString>
93 {};
94
95 template <class T>
96 struct _vm_type<
97 T,
98 std::enable_if_t<
99 is_integral_convertible_v<T>>> :
101 TypeInfo::RawType::kInt>
102 {};
103
104 template <class T>
105 struct _vm_type<
106 T,
107 std::enable_if_t<
108 is_floating_point_convertible_v<T>>> :
110 TypeInfo::RawType::kFloat>
111 {};
112
113 template <class T>
114 struct _vm_type<
115 T,
116 std::enable_if_t<
117 is_boolean_v<T>>> :
119 TypeInfo::RawType::kBool>
120 {};
121
122 template <class T>
123 struct vm_type :
124 _vm_type<
125 unwrapped_type_t<T>>
126 {};
127
128 template <class T>
130
131 template <class T>
133 std::is_same<
134 decay_pointer_t<T>,
135 StaticFunctionTag>
136 {};
137
138 template <class T>
140
141 template <class T>
143 std::conjunction<
144 is_static_base<T>,
145 std::is_pointer<T>>
146 {};
147
148 template <class T>
150
151 template <class T>
153 std::disjunction<
154 is_static_base_pointer<T>,
155 is_form_pointer<T>,
156 is_alias_pointer<T>,
157 is_active_effect_pointer<T>>
158 {};
159
160 template <class T>
162
163 template <class T>
165 std::conjunction<
166 is_not_reference<T>,
167 is_not_volatile<T>,
168 std::disjunction<
169 is_builtin<T>,
170 is_form_pointer<T>,
171 is_alias_pointer<T>,
172 is_active_effect_pointer<T>,
173 is_array<T>,
174 is_reference_wrapper<T>>>
175 {};
176
177 template <class T>
179
180 template <class T>
182 std::conjunction<
183 is_not_reference<T>,
184 is_not_volatile<T>,
185 std::disjunction<
186 is_builtin_convertible<T>,
187 is_form_pointer<T>,
188 is_alias_pointer<T>,
189 is_active_effect_pointer<T>,
190 is_array<T>,
191 is_reference_wrapper<T>>>
192 {};
193
194 template <class T>
196
197 template <class T>
199 std::conjunction<
200 is_not_const<T>,
201 is_not_reference_wrapper<T>,
202 is_valid_parameter<T>>
203 {};
204
205 template <class T>
207
208 template <class T>
210 std::conjunction<
211 std::is_base_of<
212 LatentPromiseBase,
213 typename std::coroutine_traits<T>::promise_type>,
214 is_valid_return<typename T::result_type>>
215 {};
216
217 template <class T>
219
220 template <class T>
222 std::conjunction<
223 is_not_const<T>,
224 is_not_reference_wrapper<T>,
225 is_parameter_convertible<T>>
226 {};
227
228 template <class T>
230
231 template <class R, class Cls, class... Args>
233 std::conjunction<
234 is_return_convertible<R>,
235 is_valid_base<Cls>,
236 is_parameter_convertible<Args>...>
237 {};
238
239 template <class R, class Cls, class... Args>
240 inline constexpr bool is_valid_short_sig_v = is_valid_short_sig<R, Cls, Args...>::value;
241
242 template <class Int, class R, class Cls, class... Args>
244 std::conjunction<
245 is_integral<Int>,
246 is_valid_short_sig<R, Cls, Args...>>
247 {};
248
249 template <class Int, class R, class Cls, class... Args>
250 inline constexpr bool is_valid_long_sig_v = is_valid_long_sig<Int, R, Cls, Args...>::value;
251
252 template <class Int, class R, class Cls, class... Args>
254 std::conjunction<
255 is_integral<Int>,
256 is_valid_latent_return<R>,
257 is_valid_base<Cls>,
258 is_parameter_convertible<Args>...>
259 {};
260
261 template <class Int, class R, class Cls, class... Args>
262 inline constexpr bool is_valid_latent_sig_v = is_valid_latent_sig<Int, R, Cls, Args...>::value;
263 }
264}
RawType
Definition: TypeInfo.h:13
Definition: ReferenceArray.h:13
constexpr bool is_valid_parameter_v
Definition: TypeTraits.h:178
constexpr TypeInfo::RawType vm_type_v
Definition: TypeTraits.h:129
constexpr bool is_static_base_v
Definition: TypeTraits.h:139
typename decay_pointer< T >::type decay_pointer_t
Definition: CommonTypeTraits.h:200
constexpr bool is_valid_long_sig_v
Definition: TypeTraits.h:250
typename unwrapped_type< T >::type unwrapped_type_t
Definition: TypeTraits.h:69
constexpr bool is_valid_latent_sig_v
Definition: TypeTraits.h:262
constexpr bool is_valid_short_sig_v
Definition: TypeTraits.h:240
constexpr bool is_parameter_convertible_v
Definition: TypeTraits.h:195
constexpr bool is_valid_latent_return_v
Definition: TypeTraits.h:218
constexpr bool is_valid_base_v
Definition: TypeTraits.h:161
constexpr bool is_valid_return_v
Definition: TypeTraits.h:206
constexpr bool is_not_reference_wrapper_v
Definition: TypeTraits.h:43
constexpr bool is_return_convertible_v
Definition: TypeTraits.h:229
constexpr bool is_reference_wrapper_v
Definition: TypeTraits.h:34
constexpr bool is_static_base_pointer_v
Definition: TypeTraits.h:149
Definition: AbsorbEffect.h:6
Definition: NiBinaryStream.h:94
Definition: TypeTraits.h:19
Definition: TypeTraits.h:47
decay_pointer_t< T > type
Definition: TypeTraits.h:48
Definition: TypeTraits.h:78
Definition: TypeTraits.h:40
Definition: TypeTraits.h:192
Definition: TypeTraits.h:31
Definition: TypeTraits.h:226
Definition: TypeTraits.h:146
Definition: TypeTraits.h:136
Definition: TypeTraits.h:158
Definition: TypeTraits.h:215
Definition: TypeTraits.h:259
Definition: TypeTraits.h:247
Definition: TypeTraits.h:175
Definition: TypeTraits.h:203
Definition: TypeTraits.h:237
Definition: TypeTraits.h:66
Definition: TypeTraits.h:75
Definition: TypeTraits.h:126
Definition: TypeTraits.h:10