std::execution::schedule, std::execution::schedule_result_t
来自 cppreference.cn
定义于头文件 <execution> |
||
struct schedule_t { /*unspecified*/ }; |
(1) | (since C++26) |
inline constexpr schedule_t schedule{}; |
(2) | (since C++26) (customization point object) |
调用签名 |
||
execution::sender auto schedule( execution::scheduler auto sch ); |
(since C++26) | |
辅助结果类型 |
||
template< execution::scheduler Sch > using schedule_result_t = decltype(schedule(std::declval<Sch>())); |
(3) | (since C++26) |
获取一个发送器,描述在提供的调度器上任务图的开始。
对于子表达式 sch,表达式 schedule(sch) 与 表达式等价 于 sch.schedule()。
定制点对象
`execution::schedule` 名称表示一个*定制点对象*,它是一个字面半正则类类型的 const 函数对象。其类型的非 cv 限定版本是一个标记类型,表示为 execution::schedule_t
。
`execution::schedule_t` 的所有实例均相等。在相同参数上调用 execution::schedule_t
类型的不同实例的效果是等效的,无论表示该实例的表达式是左值还是右值,以及是否具有 const 限定符(但是,不要求可调用 volatile 限定的实例)。因此,execution::schedule
可以自由复制,并且其副本可以互换使用。
给定一组类型 Args...
,如果 std::declval<Args>()... 满足上述 execution::schedule
参数的要求,则 execution::schedule_t
建模
- std::invocable<execution::schedule_t, Args...>,
- std::invocable<const execution::schedule_t, Args...>,
- std::invocable<execution::schedule_t&, Args...>, 和
- std::invocable<const execution::schedule_t&, Args...>.
否则,execution::schedule_t
的函数调用运算符均不参与重载决议。
[编辑] 示例
本节尚不完整 原因:没有示例 |