YSTest: invoke.hpp 文件参考

YSTest PreAlpha_b900_20201012 The YSLib Test Project

类 | 命名空间 | 类型定义 | 函数
invoke.hpp 文件参考
YBaseLib » YStandardExtend

可调用对象和调用包装接口。 更多...

`#include "meta.hpp"`
`#include "variadic.hpp"`
`#include <functional>`
`#include "cassert.h"`
invoke.hpp 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

## 类

struct | ystdex::pseudo_output
| 伪输出对象。 更多...
struct | ystdex::details::member_target_type_impl< _type >
struct | ystdex::details::member_target_type_impl< _type _tClass::* >
struct | ystdex::is_std_reference_wrapper< typename >
| 判断模板参数指定的类型是否为标注库引用包装的实例。 更多...
struct | ystdex::is_std_reference_wrapper< std::reference_wrapper< _type > >
struct | ystdex::details::inv_unwrap< _type, _type2 >
struct | ystdex::details::inv_unwrap< _type, std::reference_wrapper< _type2 > >
struct | ystdex::details::inv_is_mem_ref< typename, typename >
struct | ystdex::details::inv_is_mem_ref< _tRet _tClass::*, _tParam >
struct | ystdex::details::inv_mem_ptr< class, bool, bool, typename >
struct | ystdex::details::inv_mem_ptr< fproto< _tMemPtr, _type, _tParams... >, true, true, void_t< invoke_mem_fn_ref_t< _tMemPtr, _type, _tParams... > > >
struct | ystdex::details::inv_mem_ptr< fproto< _tMemPtr, _type, _tParams... >, true, false, void_t< invoke_mem_fn_deref_t< _tMemPtr, _type, _tParams... > > >
struct | ystdex::details::inv_mem_ptr< fproto< _tMemPtr, _type >, false, true, void_t< invoke_mem_obj_ref_t< _tMemPtr, _type > > >
struct | ystdex::details::inv_mem_ptr< fproto< _tMemPtr, _type >, false, false, void_t< invoke_mem_obj_deref_t< _tMemPtr, _type > > >
struct | ystdex::details::inv_other< class, typename >
struct | ystdex::details::inv_other< fproto< _fCallable, _tParams... >, void_t< invoke_other_t< _fCallable, _tParams... > > >
struct | ystdex::details::inv_mem< _tMemPtr, _tParam, _tParams >
struct | ystdex::details::inv_test< bool, _fCallable, _tParams >
struct | ystdex::details::inv_test< true, _fCallable, _tParam, _tParams... >
struct | ystdex::details::inv_enabled< typename, class, typename >
struct | ystdex::details::inv_enabled< _fCallable, fproto< _tRet, _tParams... >, void_t< inv_result_t< _fCallable, _tParams... > > >
struct | ystdex::details::inv_enabled_nt< typename, typename, typename >
struct | ystdex::details::inv_enabled_nt< _fCallable, fproto< _tRet, _tParams... >, void_t< inv_result_t< _fCallable, _tParams... > > >
struct | ystdex::cpp2017::is_invocable< _fCallable, _tParams >
struct | ystdex::cpp2017::is_invocable_r< _tRet, _fCallable, _tParams >
struct | ystdex::cpp2017::is_nothrow_invocable< _fCallable, _tParams >
struct | ystdex::cpp2017::is_nothrow_invocable_r< _tRet, _fCallable, _tParams >
struct | ystdex::cpp2017::invoke_result< _fCallable, _tParams >
struct | ystdex::details::is_callable_target< _type, _tCallable >
struct | ystdex::details::is_callable_case1< _fCallable, _type >
struct | ystdex::details::is_callable_case2< _fCallable, _type >
struct | ystdex::details::is_callable_case2a< _fCallable, _type >
struct | ystdex::details::is_callable_case2b< _fCallable, _type >
struct | ystdex::details::is_callable_case3< _fCallable, _type >
struct | ystdex::details::is_callable_case4< _fCallable, _type >
struct | ystdex::details::is_callable_case4a< _fCallable, _type >
struct | ystdex::details::is_callable_case4b< _fCallable, _type >

## 命名空间

| ystdex
| `<memory>` 特性测试宏。
| ystdex::details
| ystdex::cpp2017
| 取约束范围的值。

## 类型定义

template<typename _type , typename _tRes = pseudo_output>
using | ystdex::nonvoid_result_t = cond_t< not_< is_void< _type > >, _type, pseudo_output >
| 若类型不是空类型则取后备结果类型（默认为 pseudo_output ）。 更多...
template<typename _type , typename _tRes = pseudo_output>
using | ystdex::object_result_t = cond_t< is_object< _type >, _type, pseudo_output >
| 若类型不是对象类型则取后备结果类型（默认为 pseudo_output ）。 更多...
template<typename _type >
using | ystdex::member_target_type_t = _t< details::member_target_type_impl< _type > >
| 取成员指针类型指向的类类型。 更多...
template<typename _fCallable , typename _type , typename... _tParams>
using | ystdex::invoke_mem_fn_ref_t = decltype((std::declval< _type >().*std::declval< _fCallable >())(std::declval< _tParams >()...))
| INVOKE 调用分派。 更多...
template<typename _fCallable , typename _type , typename... _tParams>
using | ystdex::invoke_mem_fn_deref_t = decltype(((*std::declval< _type >()).*std::declval< _fCallable >())(std::declval< _tParams >()...))
template<typename _fCallable , typename _type >
using | ystdex::invoke_mem_obj_ref_t = decltype(std::declval< _type >().*std::declval< _fCallable >())
template<typename _fCallable , typename _type >
using | ystdex::invoke_mem_obj_deref_t = decltype((*std::declval< _type >()).*std::declval< _fCallable >())
template<typename _fCallable , typename... _tParams>
using | ystdex::invoke_other_t = decltype(std::declval< _fCallable >()(std::declval< _tParams >()...))
template<typename _type >
using | ystdex::details::inv_unwrap_t = _t< inv_unwrap< _type > >
template<typename _fCallable , typename... _tParams>
using | ystdex::details::fproto = empty_base< _fCallable, _tParams... >
template<typename _fCallable , typename... _tParams>
using | ystdex::details::inv_result = inv_test< is_member_pointer< remove_reference_t< _fCallable > >::value, _fCallable, _tParams... >
template<typename _fCallable , typename... _tParams>
using | ystdex::details::inv_result_t = _t< inv_result< _fCallable, _tParams... > >
template<typename _fCallable , typename... _tParams>
using | ystdex::cpp2017::invoke_result_t = _t< invoke_result< _fCallable, _tParams... > >

## 函数

template<typename _fCallable , typename _type , typename... _tParams>
auto | ystdex::details::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)...))>
template<typename _fCallable , typename _type >
auto | ystdex::details::invoke_impl (_fCallable &&f, _type &&obj) -> enable_if_t< is_callable_case3< decay_t< _fCallable >, _type >::value, decltype(std::forward< decltype(obj)>(obj).*f)>
template<typename _func , typename... _tParams>
auto | ystdex::details::invoke_impl (_func &&f, _tParams &&... args) -> enable_if_t<!is_member_pointer< decay_t< _func >>::value, decltype(std::forward< decltype(f)>(f)(std::forward< decltype(args)>(args)...))>
template<typename _fCallable , typename... _tParams>
invoke_result_t< _fCallable, _tParams... > | ystdex::invoke (_fCallable &&f, _tParams &&... args)
| 调用可调用对象。 更多...
template<typename _fCallable , typename... _tParams>
pseudo_output | ystdex::details::invoke_nonvoid_impl (true_, _fCallable &&f, _tParams &&... args)
template<typename _fCallable , typename... _tParams>
invoke_result_t< _fCallable, _tParams... > | ystdex::details::invoke_nonvoid_impl (false_, _fCallable &&f, _tParams &&... args)
template<typename _fCallable , typename... _tParams>
nonvoid_result_t< invoke_result_t< _fCallable, _tParams... > > | ystdex::invoke_nonvoid (_fCallable &&f, _tParams &&... args)
| 调用可调用对象，保证返回值非空。 更多...
template<typename _type , typename _func >
auto | ystdex::invoke_value_or (_func f, _type &&p) -> decay_t< decltype(ystdex::invoke(f, *std::forward< decltype(p)>(p)))>
| 使用 invoke 调用非空值或取默认值。 更多...
template<typename _tOther , typename _type , typename _func >
auto | ystdex::invoke_value_or (_func f, _type &&p, _tOther &&other) -> decltype(p ? ystdex::invoke(f, *std::forward< decltype(p)>(p)) :std::forward< decltype(other)>(other))
template<typename _tOther , typename _type , typename _func , typename _tSentinal = nullptr_t>
auto | ystdex::invoke_value_or (_func f, _type &&p, _tOther &&other, _tSentinal &&last) -> decltype(!bool(p==std::forward< decltype(last)>(last)) ? ystdex::invoke(f, *std::forward< decltype(p)>(p)) :std::forward< decltype(other)>(other))

## 详细描述

可调用对象和调用包装接口。

版本
  r4617

作者
  FrankHB frank.nosp@m.hb19.nosp@m.89@gm.nosp@m.ail..nosp@m.com

自从
  build 832

创建时间:
  2018-07-24 05:03:12 +0800

修改时间:
  2020-07-17 01:25 +0800

文本编码:
  UTF-8

模块名称:
  YStandardEx::Invoke

在文件 invoke.hpp 中定义.