名稱空間
變體
操作

std::generator<Ref,V,Allocator>::begin

來自 cppreference.com
< cpp‎ | 協程‎ | generator
 
 
 
協程支援
協程特質
協程控制代碼
無操作協程
平凡可等待物件
範圍生成器 (Range generators)
(C++23)
 
範圍庫 (Ranges library)
範圍介面卡 (Range adaptors)
 
 
/*iterator*/ begin();
(C++23 起)

coroutine_ 推入 *active_ 棧中,然後計算 coroutine_.resume()

在呼叫 begin() 之前,coroutine_ 必須引用一個在其初始暫停點暫停的協程。

[編輯] 返回值

一個迭代器,其 coroutine_ 成員引用與 coroutine_ 相同的協程。

[編輯] 注意

在同一個 generator 物件上多次呼叫 begin() 是未定義行為。

[編輯] 示例