This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
[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
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.