C++ Logo


Advanced search

coroutine generator example issue

From: dfleury2_at <dfleury2_at_[hidden]>
Date: Thu, 20 Oct 2022 09:21:20 +0200 (CEST)
I am currently working on coroutine, and how they works.

In the C++ ISO draft (N4860), on at 9.5.4-10, page 209, there is an generator example.

The line : " auto final_suspend() { return std::suspend_always{}; } " causes an issue to gcc 12.2, where it expects a noexcept qualifier for final_suspend.

At 9.5.4-15, it is said that " The expression co_await promise . final_suspend () shall not be potentially-throwing"

Here I am sure what mean exactly "shall", and if gcc is too conservative, or the example miss the noexcept qualifier.


PS: Since I have only access to the draft, may be something has changed in the final document.

Received on 2022-10-20 07:21:23