Date: Sun, 09 Aug 2026 09:08:06 +0200
On 8 August 2026 08:46:09 CEST, Ville Voutilainen via Std-Proposals <std-proposals_at_[hidden]> wrote:
>On Sat, 8 Aug 2026 at 09:43, Yexuan Xiao via Std-Proposals
><std-proposals_at_[hidden]> wrote:
>>
>> In C++, the most common use of coroutines is not generators, but asynchrony, which is the primary reason they were introduced into C++. However, generators are indeed important as well, and the new API is useful for nested generators that may throw exceptions. std::generator in C++23 supports nesting, so exceptions thrown by an inner generator are caught and rethrown by each outer generator. If the generator nesting is very deep, this overhead can be significant. However, this is uncommon in real world code, because generators typically do not have complex nesting relationships. Therefore, this improvement is mainly useful for asynchronous code, which may be nested deeply.
>
>If you co_await a C++26 sender, you get a cancellable coroutine, and
>you can cancel a C++26 std::task.
Does that do any (possibly async) work besides destroying the coroutine?
>
>The coroutines in Capy (https://github.com/cppalliance/capy) are also
>cancellable.
>On Sat, 8 Aug 2026 at 09:43, Yexuan Xiao via Std-Proposals
><std-proposals_at_[hidden]> wrote:
>>
>> In C++, the most common use of coroutines is not generators, but asynchrony, which is the primary reason they were introduced into C++. However, generators are indeed important as well, and the new API is useful for nested generators that may throw exceptions. std::generator in C++23 supports nesting, so exceptions thrown by an inner generator are caught and rethrown by each outer generator. If the generator nesting is very deep, this overhead can be significant. However, this is uncommon in real world code, because generators typically do not have complex nesting relationships. Therefore, this improvement is mainly useful for asynchronous code, which may be nested deeply.
>
>If you co_await a C++26 sender, you get a cancellable coroutine, and
>you can cancel a C++26 std::task.
Does that do any (possibly async) work besides destroying the coroutine?
>
>The coroutines in Capy (https://github.com/cppalliance/capy) are also
>cancellable.
Received on 2026-08-09 07:08:14
