Created on 2022-02-15.00:00:00 last changed 17 months ago
Proposed resolution (approved by CWG 2022-08-26):
Change in 9.5.4 [dcl.fct.def.coroutine] paragraph 8 as follows:
A suspended coroutine can be resumed to continue execution by invoking a resumption member function (17.12.4.6 [coroutine.handle.resumption]) of a coroutine handle (17.12.4 [coroutine.handle]) that refers to the coroutine. Thefunctionevaluation that invoked a resumption member function is called the resumer.
[Accepted as a DR at the November, 2022 meeting.]
Subclause 9.5.4 [dcl.fct.def.coroutine] paragraph 8 specifies:
A suspended coroutine can be resumed to continue execution by invoking a resumption member function (17.12.4.6 [coroutine.handle.resumption]) of a coroutine handle (17.12.4 [coroutine.handle]) that refers to the coroutine. The function that invoked a resumption member function is called the resumer.
However, non-functions can also resume a coroutine, for example:
Task task() {
std::cout << "in task\n";
int r = co_await Line();
std::cout << "resumed\n";
co_return r;
}
auto r = task();
auto c = (r.coro_.resume(), 0); // #1
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-07-16 13:00:43 | admin | set | status: open -> c++23 |
2023-07-16 13:00:43 | admin | set | status: drwp -> open |
2023-02-18 18:43:04 | admin | set | status: dr -> drwp |
2022-11-25 05:14:04 | admin | set | status: ready -> dr |
2022-08-26 21:45:07 | admin | set | messages: + msg6909 |
2022-08-26 21:45:07 | admin | set | status: open -> ready |
2022-02-15 00:00:00 | admin | create |