Namespaces
Variants

std::execution:: upon_stopped

From cppreference.net
定义于头文件 <execution>
execution :: sender auto upon_stopped ( execution :: sender auto input,
std:: invocable auto function ) ;
(C++26 起)

参数

input - 一旦接收到"stop token"的发送者,将通知新节点执行函数
function - 当向输入发送者发送"stopped"信号时将被调用的可调用对象

返回值

返回一个描述输入发送方所描述任务图的发送方,在输入发送方接收到"stopped"信号时,额外增加一个调用所提供函数的节点。

示例