C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Where await_transform = default?

From: Nikl Kelbon <kelbonage_at_[hidden]>
Date: Tue, 24 Sep 2024 19:03:37 +0400
No, because i need to accesss handle.promise() which cannot be accessed
from handle<void>

вт, 24 сент. 2024 г. в 18:33, Jason McKesson via Std-Proposals <
std-proposals_at_[hidden]>:

> On Tue, Sep 24, 2024 at 2:12 AM Nikl Kelbon via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
> >
> > Just where is it? Example:
> > You want to get handle from corouitne, writing awaiter:
> >
> > struct get_handle {
> > ??? handle;
> > await_ready();
> > await_suspend(...);
> > ??? await_resume { return hadle }
> > }
> >
> > So, code must know type of handle where its called.
>
> Can't you just use the type-erased form of `coroutine_handle`? Things
> like this are *why* the coroutine handle can be type-erased from its
> promise type: because most code which touches a handle doesn't really
> need to interact with the promise.
>
> Also, not all awaitables are coroutines, so it's generally not best to
> presume that you can get a handle from something you can await on.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2024-09-24 15:03:50