Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lewissbaker
Copy link

For P1477R0

@GorNishanov
Copy link
Owner

Looks good, but, usability wise, we probably need some kind of =default for it.
Any task type that does not do anything special for await_transform would need to lookup and paste the boilerplate for await_value. Source of bugs.

@lewissbaker
Copy link
Author

Can the = default definition be added later or should we target that for this change too?

@GorNishanov
Copy link
Owner

Sure thing. I am not requesting a change. Just just expressing my "feelings" about this change. :-)
Coroutine authors have to memorize this sequence by heart.

"template U&& await_value(U&& value) { return static_cast<U&&>(value); } "

Note that in the p1477r0 detached task type forgot to include the await_value in its promise definition :-p

@lewissbaker
Copy link
Author

I think it could be challenging to allow = default for an otherwise normal method. Maybe if it was named operator co_await() then it would be more palatable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants