名稱空間
變體
操作

std::execution::let_error

來自 cppreference.com
< cpp‎ | execution
 
 
 
定義於標頭檔案 <execution>
execution::sender auto

    let_error( execution::sender auto input,

               std::invocable</*errors-sent-by*/(input)...> function );
(C++26 起)

[edit] 引數

input - 當發生錯誤時,將錯誤傳送給函式的 sender
function - 可呼叫物件,在 input sender 發生錯誤時被呼叫,處理錯誤。

[edit] 返回值

返回一個 sender,它描述了由 input sender 描述的任務圖,並在發生錯誤時,添加了一個節點,用於使用 input sender 傳送的錯誤來呼叫提供的函式。

[edit] 示例