NVIDIA / stdexec

`std::execution`, the proposed C++ framework for asynchronous and parallel programming.
Apache License 2.0
1.56k stars 159 forks source link

cannot co_await on just_* #611

Closed williamspatrick closed 1 year ago

williamspatrick commented 2 years ago
            co_await std::execution::just(42);
            co_await std::execution::just_error(std::current_exception());
            co_await std::execution::just_stopped();

Is there something missing to co_await on the just_* senders? I can co_await on just(42) but not just_error and just_stopped.

../test/async/task.cpp:87:13: error: no member named ‘await_ready’ in ‘_P2300::execution::__just::__sender<_P2300::execution::__receivers::set_error_t, std::__exception_ptr::exception_ptr>’
   87 |             co_await std::execution::just_error(std::current_exception());
      |             ^~~~~~~~
../test/async/task.cpp:88:13: error: no member named ‘await_ready’ in ‘_P2300::execution::__just::__sender<_P2300::execution::__receivers::set_stopped_t>’
   88 |             co_await std::execution::just_stopped();
ericniebler commented 2 years ago

Interesting. If I had to guess, it's because these two senders (just_error, just_stopped) never complete with a value, so the code doesn't know what to report as the co_await expression's type. In those cases, we should just default to void.

Thanks for the report!