名稱空間
變體
操作

std::execution::schedule, std::execution::schedule_result_t

來自 cppreference.com
< cpp‎ | execution
 
 
 
定義於標頭檔案 <execution>
struct schedule_t { /*未指定*/ };
(1) (C++26 起)
inline constexpr schedule_t schedule{};
(2) (C++26 起)
(定製點物件)
呼叫簽名 (Call signature)
execution::sender auto schedule( execution::scheduler auto sch );
(C++26 起)
輔助結果型別
template< execution::scheduler Sch >
using schedule_result_t = decltype(schedule(std::declval<Sch>()));
(3) (C++26 起)

獲取一個描述在提供的排程器上啟動任務圖的傳送器。

對於子表示式 sch,表示式 schedule(sch) 表示式等價於 sch.schedule()

自定義點物件

名稱 execution::schedule 表示一個**定製點物件**,它是一個 字面量 semiregular 類型別的 const 函式物件。其 cv-unqualified 版本的型別是一個標籤型別,表示為 execution::schedule_t

execution::schedule_t 的所有例項都相等。在相同引數上呼叫 execution::schedule_t 型別的不同例項的效果是等價的,無論表示該例項的表示式是左值還是右值,以及是否是 const-qualified(然而,volatile-qualified 例項不要求可呼叫)。因此,execution::schedule 可以自由複製,並且其副本可以互換使用。

給定一組型別 Args...,如果 std::declval<Args>()... 滿足上述 execution::schedule 引數的要求,則 execution::schedule_t 遵循

否則,execution::schedule_t 的任何函式呼叫運算子都不參與過載決議。

[編輯章節:示例] 示例