std::execution::stopped_as_error

来自cppreference.com
< cpp‎ | execution
 
 
 
在标头 <execution> 定义
template< std::move_constructible Error >
execution::sender auto stopped_as_error( execution::sender auto snd, Error err );
(C++26 起)

[编辑] 参数

snd - 输入发送器,其停止通道被映射到 err
err - 停止通道所要映射的错误

[编辑] 返回值

返回一个发送器,将停止通道映射到一个 err 错误。

[编辑] 示例