std::execution::upon_stopped

来自cppreference.com
在标头 <experimental/execution> 定义
execution::sender auto upon_stopped(

    execution::sender auto input,
    std::invocable auto function

);
(C++26 起)

参数

input - 发送器,一旦获得“停止令牌”就提醒新节点执行函数
function - 当输入发送器发送“停止”信号时调用的可调用体

返回值

返回一个发送器,描述输入发送器所描述的任务图,并添加一个节点,当向输入发送器发送了“停止”信号时调用所提供的函数。