名稱空間
變體
操作

std::execution::let_value

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

    let_value( execution::sender auto input,

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

[edit] 引數

input - 傳送者,一旦執行便傳送函式執行所需的值
function - 可呼叫物件,將被呼叫並以輸入傳送器傳送的值作為引數

[edit] 返回值

返回一個傳送器,描述由輸入傳送器描述的任務圖,並新增一個節點,該節點以輸入傳送器傳送的值作為引數呼叫所提供的函式。

let_value 類似於 then,但是,從 then 返回的傳送器精確地傳送該函式最終返回的內容 - let_value 要求函式返回一個傳送器,並且 let_value 返回的傳送器傳送回撥返回的傳送器所傳送的值。

[edit] 示例