@@ -145,6 +145,15 @@ namespace utils {
145
145
};
146
146
};
147
147
148
+ #if __cplusplus > 201510L
149
+
150
+ template <typename ReturnType, typename ... Args>
151
+ struct function_traits <ReturnType(Args...) noexcept >
152
+ : public function_traits<ReturnType(Args...)> {
153
+ };
154
+
155
+ #endif
156
+
148
157
template <typename ReturnType, typename ... Args>
149
158
struct function_traits <ReturnType (*)(Args...)>
150
159
: public function_traits<ReturnType(Args...)> {
@@ -174,6 +183,39 @@ namespace utils {
174
183
typedef const volatile ClassType& owner_type;
175
184
};
176
185
186
+ #if __cplusplus > 201510L
187
+
188
+ template <typename ReturnType, typename ... Args>
189
+ struct function_traits <ReturnType (*)(Args...) noexcept >
190
+ : public function_traits<ReturnType(Args...)> {
191
+ };
192
+
193
+ template <typename ClassType, typename ReturnType, typename ... Args>
194
+ struct function_traits <ReturnType (ClassType::*)(Args...) noexcept >
195
+ : public function_traits<ReturnType(Args...)> {
196
+ typedef ClassType& owner_type;
197
+ };
198
+
199
+ template <typename ClassType, typename ReturnType, typename ... Args>
200
+ struct function_traits <ReturnType (ClassType::*)(Args...) const noexcept >
201
+ : public function_traits<ReturnType(Args...)> {
202
+ typedef const ClassType& owner_type;
203
+ };
204
+
205
+ template <typename ClassType, typename ReturnType, typename ... Args>
206
+ struct function_traits <ReturnType (ClassType::*)(Args...) volatile noexcept >
207
+ : public function_traits<ReturnType(Args...)> {
208
+ typedef volatile ClassType& owner_type;
209
+ };
210
+
211
+ template <typename ClassType, typename ReturnType, typename ... Args>
212
+ struct function_traits <ReturnType (ClassType::*)(Args...) const volatile noexcept >
213
+ : public function_traits<ReturnType(Args...)> {
214
+ typedef const volatile ClassType& owner_type;
215
+ };
216
+
217
+ #endif
218
+
177
219
template <typename FunctionType>
178
220
struct function_traits <std::function<FunctionType>>
179
221
: public function_traits<FunctionType> {
@@ -188,7 +230,7 @@ namespace utils {
188
230
#ifdef MEM_FN_SYMBOL_XX0SL7G4Z0J
189
231
190
232
template <typename R, typename C>
191
- struct function_traits <MEM_FN_SYMBOL_XX0SL7G4Z0J<R C::*>>
233
+ struct function_traits <MEM_FN_SYMBOL_XX0SL7G4Z0J<R ( C::*)() >>
192
234
: public function_traits<R(C*)> {
193
235
};
194
236
template <typename R, typename C, typename ... A>
@@ -207,6 +249,28 @@ namespace utils {
207
249
struct function_traits <MEM_FN_SYMBOL_XX0SL7G4Z0J<R (C::*)(A...) const volatile >>
208
250
: public function_traits<R(const volatile C*, A...)> {
209
251
};
252
+ #if __cplusplus > 201510L
253
+ template <typename R, typename C>
254
+ struct function_traits <MEM_FN_SYMBOL_XX0SL7G4Z0J<R (C::*)() noexcept >>
255
+ : public function_traits<R(C*)> {
256
+ };
257
+ template <typename R, typename C, typename ... A>
258
+ struct function_traits <MEM_FN_SYMBOL_XX0SL7G4Z0J<R (C::*)(A...) noexcept >>
259
+ : public function_traits<R(C*, A...)> {
260
+ };
261
+ template <typename R, typename C, typename ... A>
262
+ struct function_traits <MEM_FN_SYMBOL_XX0SL7G4Z0J<R (C::*)(A...) const noexcept >>
263
+ : public function_traits<R(const C*, A...)> {
264
+ };
265
+ template <typename R, typename C, typename ... A>
266
+ struct function_traits <MEM_FN_SYMBOL_XX0SL7G4Z0J<R (C::*)(A...) volatile noexcept >>
267
+ : public function_traits<R(volatile C*, A...)> {
268
+ };
269
+ template <typename R, typename C, typename ... A>
270
+ struct function_traits <MEM_FN_SYMBOL_XX0SL7G4Z0J<R (C::*)(A...) const volatile noexcept >>
271
+ : public function_traits<R(const volatile C*, A...)> {
272
+ };
273
+ #endif
210
274
211
275
#undef MEM_FN_SYMBOL_XX0SL7G4Z0J
212
276
#endif
@@ -418,6 +482,76 @@ namespace internal {
418
482
template <typename FunctionType>
419
483
struct has_function_traits <std::function<FunctionType>> : std::true_type {
420
484
};
485
+
486
+ #if __cplusplus > 201510L
487
+
488
+ template <typename ReturnType, typename ... Args>
489
+ struct has_function_traits <ReturnType(Args...) noexcept > : std::true_type {
490
+ };
491
+
492
+ template <typename ReturnType, typename ... Args>
493
+ struct has_function_traits <ReturnType (*)(Args...) noexcept > : std::true_type {
494
+ };
495
+
496
+ template <typename ReturnType, typename ClassType, typename ... Args>
497
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) noexcept > : std::true_type {
498
+ };
499
+
500
+ template <typename ReturnType, typename ClassType, typename ... Args>
501
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) const noexcept >
502
+ : std::true_type {
503
+ };
504
+
505
+ template <typename ReturnType, typename ClassType, typename ... Args>
506
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) volatile noexcept >
507
+ : std::true_type {
508
+ };
509
+
510
+ template <typename ReturnType, typename ClassType, typename ... Args>
511
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) const volatile noexcept >
512
+ : std::true_type {
513
+ };
514
+
515
+ template <typename ReturnType, typename ClassType, typename ... Args>
516
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) & noexcept > : std::true_type {
517
+ };
518
+
519
+ template <typename ReturnType, typename ClassType, typename ... Args>
520
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) const & noexcept >
521
+ : std::true_type {
522
+ };
523
+
524
+ template <typename ReturnType, typename ClassType, typename ... Args>
525
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) volatile & noexcept >
526
+ : std::true_type {
527
+ };
528
+
529
+ template <typename ReturnType, typename ClassType, typename ... Args>
530
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) const volatile & noexcept >
531
+ : std::true_type {
532
+ };
533
+
534
+ template <typename ReturnType, typename ClassType, typename ... Args>
535
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) && noexcept >
536
+ : std::true_type {
537
+ };
538
+
539
+ template <typename ReturnType, typename ClassType, typename ... Args>
540
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) const && noexcept >
541
+ : std::true_type {
542
+ };
543
+
544
+ template <typename ReturnType, typename ClassType, typename ... Args>
545
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) volatile && noexcept >
546
+ : std::true_type {
547
+ };
548
+
549
+ template <typename ReturnType, typename ClassType, typename ... Args>
550
+ struct has_function_traits <ReturnType (ClassType::*)(Args...) const volatile && noexcept >
551
+ : std::true_type {
552
+ };
553
+
554
+ #endif
421
555
}
422
556
}
423
557
0 commit comments