Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion include/stdexec/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,22 @@ namespace stdexec {
__callable<__connect_awaitable_t, __tfx_sender<_Sender, _Receiver>, _Receiver>;

struct connect_t {

template <class _Sender, class _Env>
static constexpr bool __check_signatures() {
if constexpr (sender_in<_Sender, _Env>) {
// Instantiate __debug_sender via completion_signatures_of_t
// to check that the actual completions match the expected
// completions.
//
// Instantiate completion_signatures_of_t only if sender_in
// is true to workaround Clang not implementing CWG#2369 yet (connect()
// does have a constraint for _Sender satisfying sender_in).
using __checked_signatures [[maybe_unused]] = completion_signatures_of_t<_Sender, _Env>;
}
return true;
}

template <class _Sender, class _Receiver>
static constexpr auto __select_impl() noexcept {
// Report that 2300R5-style senders and receivers are deprecated:
Expand All @@ -2015,6 +2031,8 @@ namespace stdexec {
if constexpr (!enable_receiver<__decay_t<_Receiver>>)
_PLEASE_UPDATE_YOUR_RECEIVER_TYPE< __decay_t<_Receiver>>();

static_assert(__check_signatures<_Sender, env_of_t<_Receiver>>());

using _Domain = __env_domain_of_t<env_of_t<_Receiver&>>;
constexpr bool _NothrowTfxSender =
__nothrow_callable<get_env_t, _Receiver&>
Expand Down Expand Up @@ -4341,7 +4359,7 @@ namespace stdexec {
__cvref_t<_CvrefSenderId>,
__env_t<__t<_EnvId>>,
completion_signatures<
set_error_t(const std::exception_ptr&),
set_error_t(std::exception_ptr&&),
set_stopped_t()>, // NOT TO SPEC
__q<__set_value_t>,
__q<__set_error_t>>;
Expand Down