命名空间
变体
操作

std::execution::just_stopped

来自 cppreference.cn
< cpp‎ | execution
 
 
 
定义于头文件 <execution>
inline constexpr just_stopped_t just_stopped{};
struct just_stopped_t { /*unspecified*/ };
(C++26 起)
(定制点对象)
调用签名 (Call signature)
execution::sender auto just_stopped();
(C++26 起)

一个发送者工厂,它返回一个通过调用接收者的 set_stopped() 立即完成的发送者。

表达式 just_stopped() 表达式等价于 /*make-sender*/(just_stopped)

自定义点对象

名称 execution::just_stopped 表示一个定制点对象,它是一个 const 函数对象,类型为 字面量 semiregular 类类型。其类型未经 cv 限定的版本是一个标签类型,表示为 execution::just_stopped_t

execution::just_stopped_t 的所有实例均相等。在相同参数上调用不同 execution::just_stopped_t 类型实例的效果是等价的,无论表示该实例的表达式是左值还是右值,以及是否为 const 限定(但是,volatile 限定的实例不要求可调用)。因此,execution::just_stopped 可以自由复制,并且其副本可以互换使用。

给定一组类型 Args...,如果 std::declval<Args>()... 满足上面 execution::just_stopped 的参数要求,则 execution::just_stopped_t 建模:

否则,execution::just_stopped_t 的函数调用运算符不参与重载决议。

[编辑] 示例