Boost logo

Boost :

From: Klemens Morgenstern (klemensdavidmorgenstern_at_[hidden])
Date: 2023-09-23 14:33:53


>> > Still I am convinced that as a user of this library I need to know what is going on in `await_transform` of different types, and when I am engaging them.
>>
>> You don't: https://klemens.dev/async/reference.html#enable_awaitables
>
>
> That section says: Inheriting enable_awaitables will enable a coroutine to co_await anything through await_transform that would be co_await-able in the absence of any await_transform.
>
> Under my present understanding of the library, it means that enable_awaitables does nothing: if things I pass are co_awaitable anyway, why would I enable anything?

Well that's where C++ is confusing:

1. if the promise has now await_transform function defined, a co_await
statement will use the .await_* functions or operator co_await
2. if any await_transform function is defined everything needs to be
explicitly supported by an await_transform

That is: once you have any await_transform, you need to opt into
awaitable types. So yes, it's a passthrough, but it needs to be
explicitly so.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk