YSTest: invoke.hpp 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

invoke.hpp
浏览该文件的文档.
1 /*
2 © 2010-2020 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef YB_INC_ystdex_invoke_hpp_
29 #define YB_INC_ystdex_invoke_hpp_ 1
30
31 #include "meta.hpp" // for "meta.hpp", <type_traits>, std::declval,
32 // __cpp_lib_is_invocable, void_t, false_, true_, remove_cvref, is_base_of,
33 // or_, is_void, is_same_or_convertible, is_implicitly_nothrow_constructible,
34 // __cpp_lib_invoke, and_;
35 #include "variadic.hpp" // for vseq::apply_t, vseq::_a, conditional_t;
36 #include <functional> // for <functional>, std::reference_wrapper;
37 #include "cassert.h" // for yconstraint;
38
46 #ifndef __cpp_lib_transparent_operators
47 # if YB_IMPL_MSCPP >= 1800 || __cplusplus >= 201210L
48 # define __cpp_lib_transparent_operators 201210L
49 # endif
50 #endif
51 #ifndef __cpp_lib_invoke
52 # if YB_IMPL_MSCPP >= 1900 || __cplusplus >= 201411L
53 # define __cpp_lib_invoke 201411L
54 # endif
55 #endif
56
57
58 namespace ystdex
59 {
60
66 struct pseudo_output
67 {
69
70 template<typename... _tParams>
71 yconstfn
72 pseudo_output(_tParams&&...) ynothrow
73 {}
74
75 template<typename _tParam,
76 yimpl(exclude_self_t<pseudo_output, _tParam>)>
77 yconstfn const pseudo_output&
78 operator=(_tParam&&) const ynothrow
79 {
80 return *this;
81 }
82 template<typename... _tParams>
83 yconstfn const pseudo_output&
84 operator()(_tParams&&...) const ynothrow
85 {
86 return *this;
87 }
89 };
90
91
98 template<typename _type, typename _tRes = pseudo_output>
100 using nonvoid_result_t = cond_t<not_<is_void<_type>>, _type, pseudo_output>;
101
103 template<typename _type, typename _tRes = pseudo_output>
104 using object_result_t = cond_t<is_object<_type>, _type, pseudo_output>;
106
107
109 namespace details
110 {
111
113
114 template<typename _type>
115 struct member_target_type_impl
116 {
117 using type = void;
118 };
119
120 template<class _tClass, typename _type>
121 struct member_target_type_impl<_type _tClass::*>
122 {
123 using type = _tClass;
124 };
126
127 } // namespace details;
128
130
131
135 template<typename _type>
136 using member_target_type_t = _t<details::member_target_type_impl<_type>>;
137
145 template<typename _fCallable, typename _type, typename... _tParams>
146 using invoke_mem_fn_ref_t = decltype((std::declval<_type>().*std::declval<
147 _fCallable>())(std::declval<_tParams>()...));
148
149 template<typename _fCallable, typename _type, typename... _tParams>
150 using invoke_mem_fn_deref_t = decltype(((*std::declval<_type>()).*std::declval<
151 _fCallable>())(std::declval<_tParams>()...));
152
153 template<typename _fCallable, typename _type>
154 using invoke_mem_obj_ref_t
155 = decltype(std::declval<_type>().*std::declval<_fCallable>());
156
157 template<typename _fCallable, typename _type>
158 using invoke_mem_obj_deref_t
159 = decltype((*std::declval<_type>()).*std::declval<_fCallable>());
160
161 template<typename _fCallable, typename... _tParams>
162 using invoke_other_t
163 = decltype(std::declval<_fCallable>()(std::declval<_tParams>()...));
165
166
167
174 template<typename>
175 struct is_std_reference_wrapper : false_type
176 {};
177
178 template<typename _type>
179 struct is_std_reference_wrapper<std::reference_wrapper<_type>> : true_type
180 {};
182
183
184 #if !(__cpp_lib_is_invocable >= 201703L)
185 namespace details
187 {
188
189 template<typename _type, typename _type2 = decay_t<_type>>
190 struct inv_unwrap
191 {
192 using type = _type;
193 };
194
195 template<typename _type, typename _type2>
196 struct inv_unwrap<_type, std::reference_wrapper<_type2>>
197 {
198 using type = _type2&;
199 };
200
201 template<typename _type>
202 using inv_unwrap_t = _t<inv_unwrap<_type>>;
203
204
205 // XXX: The 'ref' and 'deref' variants of tempaltes cannot be combined because
206 // it might cause redefinitions of specializations. Note the bug can be hardly
207 // detected, however 'clang++-7 -std=gnu++11' (not '-std=c++11') complaints
208 // this even when not collided anyway, perhaps due to missing of resolution of
209 // CWG 1558.
211
212 template<typename, typename>
213 struct inv_is_mem_ref;
214
215 template<typename _tRet, class _tClass, typename _tParam>
216 struct inv_is_mem_ref<_tRet _tClass::*, _tParam>
217 : is_base_of<_tClass, remove_cvref_t<_tParam>>
218 {};
219
220
222 template<typename _fCallable, typename... _tParams>
223 using fproto = empty_base<_fCallable, _tParams...>;
224
225 template<class, bool, bool, typename = void>
226 struct inv_mem_ptr
227 {
229 static const yconstexpr bool noexcept_v = {};
230 };
231
233
234 template<typename _tMemPtr, typename _type, typename... _tParams>
235 struct inv_mem_ptr<fproto<_tMemPtr, _type, _tParams...>, true, true,
236 void_t<invoke_mem_fn_ref_t<_tMemPtr, _type, _tParams...>>>
237 : identity<invoke_mem_fn_ref_t<_tMemPtr, _type, _tParams...>>
238 {
239 static const yconstexpr bool noexcept_v = ynoexcept((std::declval<
240 inv_unwrap_t<_type>>().*std::declval<_tMemPtr>())(
241 std::declval<_tParams>()...));
242 };
243
244 template<typename _tMemPtr, typename _type, typename... _tParams>
245 struct inv_mem_ptr<fproto<_tMemPtr, _type, _tParams...>, true, false,
246 void_t<invoke_mem_fn_deref_t<_tMemPtr, _type, _tParams...>>>
247 : identity<invoke_mem_fn_deref_t<_tMemPtr, _type, _tParams...>>
248 {
249 static const yconstexpr bool noexcept_v = ynoexcept(((*std::declval<
250 _type>()).*std::declval<_tMemPtr>())(std::declval<_tParams>()...));
251 };
252
253 template<typename _tMemPtr, typename _type>
254 struct inv_mem_ptr<fproto<_tMemPtr, _type>, false, true,
255 void_t<invoke_mem_obj_ref_t<_tMemPtr, _type>>>
256 : identity<invoke_mem_obj_ref_t<_tMemPtr, _type>>
257 {
258 static const yconstexpr bool noexcept_v = ynoexcept(
259 std::declval<inv_unwrap_t<_type>>().*std::declval<_tMemPtr>());
260 };
261
262 template<typename _tMemPtr, typename _type>
263 struct inv_mem_ptr<fproto<_tMemPtr, _type>, false, false,
264 void_t<invoke_mem_obj_deref_t<_tMemPtr, _type>>>
265 : identity<invoke_mem_obj_deref_t<_tMemPtr, _type>>
266 {
267 static const yconstexpr bool noexcept_v
268 = ynoexcept((*std::declval<_type>()).*std::declval<_tMemPtr>());
269 };
271
272
273 template<class, typename = void>
274 struct inv_other
275 {
277 static const yconstexpr bool noexcept_v = {};
278 };
279
280 template<typename _fCallable, typename... _tParams>
281 struct inv_other<fproto<_fCallable, _tParams...>,
282 void_t<invoke_other_t<_fCallable, _tParams...>>>
283 : identity<invoke_other_t<_fCallable, _tParams...>>
284 {
285 static const yconstexpr bool noexcept_v
286 = ynoexcept(std::declval<_fCallable>()(std::declval<_tParams>()...));
287 };
288
289
291
292 template<typename _tMemPtr, typename _tParam, typename... _tParams>
293 struct inv_mem : inv_mem_ptr<fproto<_tMemPtr, inv_unwrap_t<_tParam>,
294 _tParams...>, is_member_function_pointer<_tMemPtr>::value,
295 inv_is_mem_ref<_tMemPtr, _tParam>::value>
296 {};
297
298
299 template<bool, typename _fCallable, typename... _tParams>
300 struct inv_test : inv_other<fproto<_fCallable, _tParams...>>
301 {};
302
303 template<typename _fCallable, typename _tParam, typename... _tParams>
304 struct inv_test<true, _fCallable, _tParam, _tParams...>
305 : inv_mem<decay_t<_fCallable>, _tParam, _tParams...>
306 {};
308
309
310 template<typename _fCallable, typename... _tParams>
311 using inv_result = inv_test<is_member_pointer<
312 remove_reference_t<_fCallable>>::value, _fCallable, _tParams...>;
313
314 template<typename _fCallable, typename... _tParams>
315 using inv_result_t = _t<inv_result<_fCallable, _tParams...>>;
316
317
318 template<typename, class, typename = void>
319 struct inv_enabled : false_
320 {};
321
323 template<typename _tRet, typename _fCallable, typename... _tParams>
324 struct inv_enabled<_fCallable, fproto<_tRet, _tParams...>,
325 void_t<inv_result_t<_fCallable, _tParams...>>>
326 : or_<is_void<_tRet>,
327 is_same_or_convertible<inv_result_t<_fCallable, _tParams...>, _tRet>>
328 {};
329
330 template<typename, typename, typename = void>
331 struct inv_enabled_nt : false_
332 {};
333
335 template<typename _tRet, typename _fCallable, typename... _tParams>
336 struct inv_enabled_nt<_fCallable, fproto<_tRet, _tParams...>,
337 void_t<inv_result_t<_fCallable, _tParams...>>>
338 : or_<is_void<_tRet>, is_implicitly_nothrow_constructible<_tRet,
339 inv_result_t<_fCallable, _tParams...>>>
340 {};
341
342 } // namespace details;
343 #endif
344
345 inline namespace cpp2017
346 {
347
349
350 #if __cpp_lib_is_invocable >= 201703L
351 using std::is_invocable;
352 using std::is_invocable_r;
353 using std::is_nothrow_invocable;
354 using std::is_nothrow_invocable_r;
355
356 using std::invoke_result;
357 using std::invoke_result_t;
358 #else
359
361 template<typename _fCallable, typename... _tParams>
362 struct is_invocable
363 : details::inv_enabled<_fCallable, details::fproto<void, _tParams...>>
364 {};
365
366 template<typename _tRet, typename _fCallable, typename... _tParams>
367 struct is_invocable_r
368 : details::inv_enabled<_fCallable, details::fproto<_tRet, _tParams...>>
369 {};
370
371 template<typename _fCallable, typename... _tParams>
372 struct is_nothrow_invocable
373 : bool_constant<is_invocable<_fCallable, _tParams...>::value
374 && details::inv_result<_fCallable, _tParams...>::noexcept_v>
375 {};
376
377 template<typename _tRet, typename _fCallable, typename... _tParams>
378 struct is_nothrow_invocable_r : bool_constant<details::inv_enabled_nt<
379 _fCallable, details::fproto<_tRet, _tParams...>>::value
380 && details::inv_result<_fCallable, _tParams...>::noexcept_v>
381 {};
383
384
386
387 template<typename _fCallable, typename... _tParams>
388 struct invoke_result
389 : details::inv_result<_fCallable, _tParams...>
390 {};
391
392 template<typename _fCallable, typename... _tParams>
393 using invoke_result_t = _t<invoke_result<_fCallable, _tParams...>>;
395 #endif
396
397
398 } // inline namespace cpp2017;
399
400
401 #if __cpp_lib_invoke >= 201411L
402 using std::invoke;
404 #else
405 namespace details
407 {
408
409 template<typename _type, typename _tCallable>
410 struct is_callable_target
411 : is_base_of<member_target_type_t<_tCallable>, decay_t<_type>>
412 {};
413
414 template<typename _fCallable, typename _type>
415 struct is_callable_case1 : and_<is_member_function_pointer<_fCallable>,
416 is_callable_target<_type, _fCallable>>
417 {};
418
419 template<typename _fCallable, typename _type>
420 struct is_callable_case2 : and_<is_member_function_pointer<_fCallable>,
421 not_<is_callable_target<_type, _fCallable>>>
422 {};
423
425 template<typename _fCallable, typename _type>
426 struct is_callable_case2a : and_<is_callable_case2<_fCallable, _type>,
427 is_std_reference_wrapper<decay_t<_type>>>
428 {};
429
431 template<typename _fCallable, typename _type>
432 struct is_callable_case2b : and_<is_callable_case2<_fCallable, _type>,
433 not_<is_std_reference_wrapper<decay_t<_type>>>>
434 {};
435
436 template<typename _fCallable, typename _type>
437 struct is_callable_case3 : and_<is_member_object_pointer<_fCallable>,
438 is_callable_target<_type, _fCallable>>
439 {};
440
441 template<typename _fCallable, typename _type>
442 struct is_callable_case4 : and_<is_member_object_pointer<_fCallable>,
443 not_<is_callable_target<_type, _fCallable>>>
444 {};
445
447 template<typename _fCallable, typename _type>
448 struct is_callable_case4a : and_<is_callable_case4<_fCallable, _type>,
449 is_std_reference_wrapper<decay_t<_type>>>
450 {};
451
453 template<typename _fCallable, typename _type>
454 struct is_callable_case4b : and_<is_callable_case4<_fCallable, _type>,
455 not_<is_std_reference_wrapper<decay_t<_type>>>>
456 {};
457
458
460 template<typename _fCallable, typename _type, typename... _tParams>
461 yconstfn auto
462 invoke_impl(_fCallable&& f, _type&& obj, _tParams&&... args)
463 -> enable_if_t<is_callable_case1<decay_t<_fCallable>, _type>::value,
464 decltype((yforward(obj).*f)(yforward(args)...))>
465 {
466 return yconstraint(f), (yforward(obj).*f)(yforward(args)...);
467 }
469 template<typename _fCallable, typename _type, typename... _tParams>
470 yconstfn auto
471 invoke_impl(_fCallable&& f, _type&& obj, _tParams&&... args)
472 -> enable_if_t<is_callable_case2a<decay_t<_fCallable>, _type>::value,
473 decltype((obj.get().*f)(yforward(args)...))>
474 {
475 return yconstraint(f), (obj.get().*f)(yforward(args)...);
476 }
478 template<typename _fCallable, typename _type, typename... _tParams>
479 yconstfn auto
480 invoke_impl(_fCallable&& f, _type&& obj, _tParams&&... args)
481 -> enable_if_t<is_callable_case2b<decay_t<_fCallable>, _type>::value,
482 decltype(((*yforward(obj)).*f)(yforward(args)...))>
483 {
484 return yconstraint(f), ((*yforward(obj)).*f)(yforward(args)...);
485 }
487 template<typename _fCallable, typename _type>
488 YB_PURE yconstfn auto
489 invoke_impl(_fCallable&& f, _type&& obj)
490 -> enable_if_t<is_callable_case3<decay_t<_fCallable>, _type>::value,
491 decltype(yforward(obj).*f)>
492 {
493 return yconstraint(f), yforward(obj).*f;
494 }
496 template<typename _fCallable, typename _type>
497 yconstfn auto
498 invoke_impl(_fCallable&& f, _type&& obj)
499 -> enable_if_t<is_callable_case4a<decay_t<_fCallable>, _type>::value,
500 decltype(obj.get().*f)>
501 {
502 return yconstraint(f), obj.get().*f;
503 }
505 template<typename _fCallable, typename _type>
506 yconstfn auto
507 invoke_impl(_fCallable&& f, _type&& obj)
508 -> enable_if_t<is_callable_case4b<decay_t<_fCallable>, _type>::value,
509 decltype((*yforward(obj)).*f)>
510 {
511 return yconstraint(f), (*yforward(obj)).*f;
512 }
513 template<typename _func, typename... _tParams>
514 yconstfn auto
515 invoke_impl(_func&& f, _tParams&&... args)
516 -> enable_if_t<!is_member_pointer<decay_t<_func>>::value,
517 decltype(yforward(f)(yforward(args)...))>
518 {
519 return yforward(f)(yforward(args)...);
520 }
521
522 } // namespace details;
523
536 template<typename _fCallable, typename... _tParams>
537 yimpl(yconstfn) invoke_result_t<_fCallable, _tParams...>
538 invoke(_fCallable&& f, _tParams&&... args)
539 ynoexcept(is_nothrow_invocable<_fCallable, _tParams...>::value)
540 {
541 return details::invoke_impl(yforward(f), yforward(args)...);
542 }
543 #endif
544
545 namespace details
546 {
547
549 template<typename _fCallable, typename... _tParams>
550 yconstfn pseudo_output
551 invoke_nonvoid_impl(true_, _fCallable&& f, _tParams&&... args)
552 {
553 return ystdex::invoke(yforward(f), yforward(args)...), pseudo_output();
554 }
556 template<typename _fCallable, typename... _tParams>
557 inline invoke_result_t<_fCallable, _tParams...>
558 invoke_nonvoid_impl(false_, _fCallable&& f, _tParams&&... args)
559 {
560 return ystdex::invoke(yforward(f), yforward(args)...);
561 }
562
563 } // namespace details;
564
570 template<typename _fCallable, typename... _tParams>
571 yimpl(yconstfn) nonvoid_result_t<invoke_result_t<_fCallable, _tParams...>>
572 invoke_nonvoid(_fCallable&& f, _tParams&&... args)
573 {
574 return details::invoke_nonvoid_impl(is_void<invoke_result_t<
575 _fCallable, _tParams...>>(), yforward(f), yforward(args)...);
576 }
577
578
586 template<typename _type, typename _func>
587 yconstfn auto
588 invoke_value_or(_func f, _type&& p)
589 -> decay_t<decltype(ystdex::invoke(f, *yforward(p)))>
590 {
591 return p ? ystdex::invoke(f, *yforward(p))
592 : decay_t<decltype(ystdex::invoke(f, *yforward(p)))>();
593 }
594 template<typename _tOther, typename _type, typename _func>
595 yconstfn auto
596 invoke_value_or(_func f, _type&& p, _tOther&& other)
597 -> yimpl(decltype(p ? ystdex::invoke(f, *yforward(p)) : yforward(other)))
598 {
599 return p ? ystdex::invoke(f, *yforward(p)) : yforward(other);
600 }
601 template<typename _tOther, typename _type, typename _func,
602 typename _tSentinal = nullptr_t>
603 yconstfn auto
604 invoke_value_or(_func f, _type&& p, _tOther&& other, _tSentinal&& last)
605 -> yimpl(decltype(!bool(p == yforward(last))
606 ? ystdex::invoke(f, *yforward(p)) : yforward(other)))
607 {
608 return !bool(p == yforward(last)) ? ystdex::invoke(f, *yforward(p))
609 : yforward(other);
610 }
612
613 } // namespace ystdex;
614
615 #endif
616
ystdex::details::inv_mem_ptr
Definition: invoke.hpp:227
meta.hpp
通用元编程设施。
ystdex::cpp2017::is_invocable_r
Definition: invoke.hpp:369
ystdex::invoke_mem_fn_deref_t
decltype(((*std::declval< _type >()).*std::declval< _fCallable >())(std::declval< _tParams >()...)) invoke_mem_fn_deref_t
Definition: invoke.hpp:151
ystdex::details::inv_other
Definition: invoke.hpp:275
ystdex::details::inv_enabled
Definition: invoke.hpp:320
ystdex::member_target_type_t
_t< details::member_target_type_impl< _type > > member_target_type_t
取成员指针类型指向的类类型。
Definition: invoke.hpp:136
ystdex::empty_base
空基类模板。
Definition: ydef.h:1424
ystdex::invoke_mem_obj_ref_t
decltype(std::declval< _type >().*std::declval< _fCallable >()) invoke_mem_obj_ref_t
Definition: invoke.hpp:155
ystdex::invoke
invoke_result_t< _fCallable, _tParams... > invoke(_fCallable &&f, _tParams &&... args)
调用可调用对象。
Definition: invoke.hpp:538
yconstexpr
#define yconstexpr
指定编译时常量表达式。
Definition: ydef.h:1072
YB_PURE
#define YB_PURE
指示函数或函数模板实例为纯函数。
Definition: ydef.h:919
ystdex::invoke_nonvoid
nonvoid_result_t< invoke_result_t< _fCallable, _tParams... > > invoke_nonvoid(_fCallable &&f, _tParams &&... args)
调用可调用对象，保证返回值非空。
Definition: invoke.hpp:572
ystdex::cpp2014::enable_if_t
typename enable_if< _bCond, _type >::type enable_if_t
Definition: meta.hpp:199
ystdex::details::inv_unwrap::type
_type type
Definition: invoke.hpp:192
ystdex::invoke_other_t
decltype(std::declval< _fCallable >()(std::declval< _tParams >()...)) invoke_other_t
Definition: invoke.hpp:163
ystdex::details::inv_other::noexcept_v
static const bool noexcept_v
Definition: invoke.hpp:277
ystdex::object_result_t
cond_t< is_object< _type >, _type, pseudo_output > object_result_t
若类型不是对象类型则取后备结果类型（默认为 pseudo_output ）。
Definition: invoke.hpp:104
ystdex::details::inv_unwrap_t
_t< inv_unwrap< _type > > inv_unwrap_t
Definition: invoke.hpp:202
ystdex::details::is_callable_case2a
Definition: invoke.hpp:428
ystdex::details::is_callable_case4b
Definition: invoke.hpp:456
ystdex::invoke_value_or
auto invoke_value_or(_func f, _type &&p) -> decay_t< decltype(ystdex::invoke(f, *std::forward< decltype(p)>(p)))>
使用 invoke 调用非空值或取默认值。
Definition: invoke.hpp:588
CHRLib::f
f(d, s)
ystdex::invoke_mem_obj_deref_t
decltype((*std::declval< _type >()).*std::declval< _fCallable >()) invoke_mem_obj_deref_t
Definition: invoke.hpp:159
ystdex::details::member_target_type_impl
Definition: invoke.hpp:116
CHRLib::args
YB_ATTR_nodiscard _tParams && args
Definition: CharacterProcessing.h:649
ystdex::cpp2017::void_t
well_formed_t< void, _types... > void_t
Definition: meta.hpp:292
ystdex::details::_type2
_type2
Definition: operators.hpp:241
ystdex::cpp2017::is_nothrow_invocable_r
Definition: invoke.hpp:381
ystdex::cpp2014::decay_t
typename decay< _type >::type decay_t
Definition: meta.hpp:196
ystdex::details::is_callable_case3
Definition: invoke.hpp:439
ystdex::details::inv_mem
Definition: invoke.hpp:296
ystdex::details::inv_enabled_nt
Definition: invoke.hpp:332
ystdex::details::is_callable_target
Definition: invoke.hpp:412
CHRLib::CharSet::other
@ other
Definition: Encoding.h:65
ystdex::identity
恒等元函数。
Definition: meta.hpp:815
ystdex::or_
逻辑或。
Definition: integral_constant.hpp:172
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 转发对应参数。
Definition: ydef.h:1508
ystdex::is_std_reference_wrapper
判断模板参数指定的类型是否为标注库引用包装的实例。
Definition: invoke.hpp:176
ystdex::details::is_callable_case2
Definition: invoke.hpp:422
ystdex::cpp2017::is_invocable
Definition: invoke.hpp:364
ystdex::details::is_callable_case4a
Definition: invoke.hpp:450
ystdex::pseudo_output::operator()
const pseudo_output & operator()(_tParams &&...) const
Definition: invoke.hpp:84
std
Definition: optional.h:982
ystdex::pseudo_output
伪输出对象。
Definition: invoke.hpp:67
ystdex::details::inv_unwrap
Definition: invoke.hpp:191
ystdex::details::inv_result_t
_t< inv_result< _fCallable, _tParams... > > inv_result_t
Definition: invoke.hpp:315
ystdex::cpp2017::is_nothrow_invocable
Definition: invoke.hpp:375
ystdex::nonvoid_result_t
cond_t< not_< is_void< _type > >, _type, pseudo_output > nonvoid_result_t
若类型不是空类型则取后备结果类型（默认为 pseudo_output ）。
Definition: invoke.hpp:100
ystdex::invoke_mem_fn_ref_t
decltype((std::declval< _type >().*std::declval< _fCallable >())(std::declval< _tParams >()...)) invoke_mem_fn_ref_t
INVOKE 调用分派。
Definition: invoke.hpp:147
ystdex::details::member_target_type_impl::type
void type
Definition: invoke.hpp:117
yconstraint
#define yconstraint(_expr)
约束：接口语义。
Definition: cassert.h:125
ystdex::cpp2017::invoke_result_t
_t< invoke_result< _fCallable, _tParams... > > invoke_result_t
Definition: invoke.hpp:393
ystdex::true_
bool_< true > true_
Definition: integral_constant.hpp:109
variadic.hpp
C++ 变长参数相关操作。
ystdex::details::inv_unwrap< _type, std::reference_wrapper< _type2 > >::type
_type2 & type
Definition: invoke.hpp:198
ystdex::cond_t
_t< cond< _tCond, _tThen, _tElse > > cond_t
Definition: meta.hpp:794
ystdex::cpp2017::bool_constant
bool_< _b > bool_constant
bool 常量。
Definition: integral_constant.hpp:131
ystdex::exclude_self_t
enable_if_t<!is_same_param< _tSelected, _tParam >::value, _type > exclude_self_t
排除选择类型的特定参数的重载。
Definition: meta.hpp:865
ystdex
<memory> 特性测试宏。
Definition: ydef.h:1262
YSLib::_tParams
YB_ATTR_nodiscard YB_PURE typename _tParams
Definition: ValueNode.h:1294
ystdex::details::invoke_nonvoid_impl
pseudo_output invoke_nonvoid_impl(true_, _fCallable &&f, _tParams &&... args)
Definition: invoke.hpp:551
ystdex::details::inv_mem_ptr::noexcept_v
static const bool noexcept_v
Definition: invoke.hpp:229
ystdex::_t
typename _type::type _t
嵌套类型别名。
Definition: meta.hpp:45
ystdex::details::inv_test
Definition: invoke.hpp:301
ystdex::cpp2017::invoke_result
Definition: invoke.hpp:390
ystdex::details::is_callable_case2b
Definition: invoke.hpp:434
ystdex::cpp2014::remove_reference_t
typename remove_reference< _type >::type remove_reference_t
Definition: meta.hpp:155
ystdex::pseudo_output::operator=
const pseudo_output & operator=(_tParam &&) const
Definition: invoke.hpp:78
platform::p
return p p
Definition: YCLib/FileSystem.h:209
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:413
platform::bool
YB_ATTR_nodiscard std::FILE *fp bool
Definition: FileIO.h:1271
cassert.h
ISO C 断言/调试跟踪扩展。
ystdex::false_
bool_< false > false_
Definition: integral_constant.hpp:110
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199
ystdex::details::inv_is_mem_ref
Definition: invoke.hpp:213
ystdex::details::is_callable_case1
Definition: invoke.hpp:417
ystdex::details::is_callable_case4
Definition: invoke.hpp:444
ynoexcept
#define ynoexcept(...)
YSLib 无异常抛出保证：指定特定的异常规范。
Definition: ydef.h:1151
ystdex::pseudo_output::pseudo_output
pseudo_output(_tParams &&...)
Definition: invoke.hpp:72
ystdex::details::member_target_type_impl< _type _tClass::* >::type
_tClass type
Definition: invoke.hpp:123
yconstfn
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:1073
ystdex::details::invoke_impl
auto invoke_impl(_fCallable &&f, _type &&obj, _tParams &&... args) -> enable_if_t< is_callable_case1< decay_t< _fCallable >, _type >::value, decltype((std::forward< decltype(obj)>(obj).*f)(std::forward< decltype(args)>(args)...))>
Definition: invoke.hpp:462
NPL::_tParam
_tParam
Definition: NPLA.h:2367
ystdex::and_
逻辑操作元函数。
Definition: integral_constant.hpp:151