Skip to content

Commit

Permalink
Merge pull request #1469 from NVIDIA/awaiter-concept
Browse files Browse the repository at this point in the history
change the `__awaiter` concept to agree with P3164
  • Loading branch information
ericniebler authored Jan 17, 2025
2 parents cab1814 + b0a0022 commit cc66ad2
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions include/stdexec/__detail/__awaitable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,13 @@ namespace stdexec {
concept __await_suspend_result =
__one_of<_Tp, void, bool> || __is_instance_of<_Tp, __coro::coroutine_handle>;

template <class _Awaiter, class _Promise>
concept __with_await_suspend =
requires(_Awaiter& __awaiter, __coro::coroutine_handle<_Promise> __h) {
{ __awaiter.await_suspend(__h) } -> __await_suspend_result;
};

template <class _Awaiter, class... _Promise>
concept __awaiter = //
requires(_Awaiter& __awaiter) {
requires(_Awaiter& __awaiter, __coro::coroutine_handle<_Promise...> __h) {
__awaiter.await_ready() ? 1 : 0;
{ __awaiter.await_suspend(__h) } -> __await_suspend_result;
__awaiter.await_resume();
} && //
(__with_await_suspend<_Awaiter, _Promise> && ...);
};

# if STDEXEC_MSVC()
// MSVCBUG https://developercommunity.visualstudio.com/t/operator-co_await-not-found-in-requires/10452721
Expand Down

0 comments on commit cc66ad2

Please sign in to comment.