std::generator<Ref,V,Allocator>::begin
来自cppreference.com
工具库
协程支持
| 协程特征 | ||||
|
(C++20)
|
||||
| 协程柄 | ||||
|
(C++20)
|
||||
| 无操作协程 | ||||
|
(C++20)
|
||||
|
(C++20)
|
||||
| 平凡可等待体 | ||||
|
(C++20)
|
||||
|
(C++20)
|
范围库
std::generator
| 成员函数 | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
generator::begin
(C++23)
|
||||
|
(C++23)
|
||||
| promise_type | ||||
| Iterator | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
/*iterator*/
begin();
|
(C++23 起) | |
将 coroutine_
推入栈 *active_
中,然后对 coroutine_.resume() 求值。
在调用 begin() 之前,coroutine_
必须指代一个在他的 初始暂停点 暂停的协程。
返回值
迭代器,其成员 coroutine_ 指代同一协程 coroutine_。
注解
在同一个 generator
对象上调用多次 begin() 的行为是未定义的。
示例
| 本节未完成 原因:暂无示例 |