Skip to content

Commit

Permalink
domain information from the predecessor overrides that of the receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
ericniebler committed Nov 9, 2023
1 parent 2e3ba0d commit 4eafc0d
Show file tree
Hide file tree
Showing 7 changed files with 252 additions and 167 deletions.
2 changes: 1 addition & 1 deletion include/exec/sequence/ignore_all_values.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ namespace exec {
struct ignore_all_values_t {
template <sender _Sender>
auto operator()(_Sender&& __sndr) const {
auto __domain = __get_sender_domain((_Sender&&) __sndr);
auto __domain = __get_early_domain((_Sender&&) __sndr);
return transform_sender(
__domain, __make_sexpr<ignore_all_values_t>(__(), (_Sender&&) __sndr));
}
Expand Down
7 changes: 4 additions & 3 deletions include/exec/sequence_senders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ namespace exec {
namespace __sequence_sndr {
struct get_item_types_t;
template <class _Sender, class _Env>
using __tfx_sender = transform_sender_result_t<__env_domain_of_t<_Env>, _Sender, _Env>;
using __tfx_sender =
transform_sender_result_t<__late_domain_of_t<_Sender, _Env>, _Sender, _Env>;

template <class _Sender, class _Env>
concept __with_tag_invoke = //
Expand Down Expand Up @@ -328,7 +329,7 @@ namespace exec {

template <class _Sender, class _Receiver>
static constexpr auto __select_impl() noexcept {
using _Domain = __env_domain_of_t<env_of_t<_Receiver&>>;
using _Domain = __late_domain_of_t<_Sender, env_of_t<_Receiver&>>;
constexpr bool _NothrowTfxSender =
__nothrow_callable<get_env_t, _Receiver&>
&& __nothrow_callable<transform_sender_t, _Domain, _Sender, env_of_t<_Receiver&>>;
Expand Down Expand Up @@ -365,7 +366,7 @@ namespace exec {
-> __call_result_t<__select_impl_t<_Sender, _Receiver>> {
using _TfxSender = __tfx_sndr<_Sender, _Receiver>;
auto&& __env = get_env(__rcvr);
auto __domain = __get_env_domain(__env);
auto __domain = __get_late_domain(__sndr, __env);
if constexpr (__next_connectable_with_tag_invoke<_TfxSender, _Receiver>) {
static_assert(
operation_state<tag_invoke_result_t<
Expand Down
2 changes: 1 addition & 1 deletion include/nvexec/stream/common.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ namespace nvexec {
sender_in<S, E> && //
STDEXEC_IS_BASE_OF(
stream_sender_base,
__decay_t<transform_sender_result_t<__env_domain_of_t<E>, S, E>>);
__decay_t<transform_sender_result_t<__late_domain_of_t<S, E>, S, E>>);

template <class R>
concept stream_receiver = //
Expand Down
55 changes: 35 additions & 20 deletions include/stdexec/__detail/__meta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ namespace stdexec {
template <class _Fn, class... _Args>
struct __mdefer : __mdefer_<_Fn, _Args...> { };

template <class _Fn, class... _Args>
using __mmemoize = __t<__mdefer<_Fn, _Args...>>;

template <template <class...> class _Fn, class... _Args>
using __mmemoize_q = __mmemoize<__q<_Fn>, _Args...>;

struct __if_ {
template <bool>
struct __ {
Expand Down Expand Up @@ -364,24 +370,6 @@ namespace stdexec {
using __f = _Tp;
};

template <template <class...> class _Try, class _Catch>
struct __mtry_catch_q {
template <class... _Args>
using __f = __minvoke< __if_c<__mvalid<_Try, _Args...>, __q<_Try>, _Catch>, _Args...>;
};

template <class _Try, class _Catch>
struct __mtry_catch {
template <class... _Args>
using __f = __minvoke< __if_c<__minvocable<_Try, _Args...>, _Try, _Catch>, _Args...>;
};

template <class _Fn, class _Default>
using __with_default = __mtry_catch<_Fn, __mconst<_Default>>;

template <template <class...> class _Fn, class _Default>
using __with_default_q = __mtry_catch_q<_Fn, __mconst<_Default>>;

inline constexpr __mstring __mbad_substitution =
"The specified meta-function could not be evaluated with the types provided."__csz;

Expand All @@ -403,6 +391,30 @@ namespace stdexec {
using __f = __mexception<_BAD_SUBSTITUTION_<>, _WITH_META_FUNCTION_, _WITH_TYPES_<_Args...>>;
};

template <template <class...> class _Try, class _Catch>
struct __mtry_catch_q {
template <class... _Args>
using __f = __minvoke< __if_c<__mvalid<_Try, _Args...>, __q<_Try>, _Catch>, _Args...>;
};

template <class _Try, class _Catch>
struct __mtry_catch {
template <class... _Args>
using __f = __minvoke< __if_c<__minvocable<_Try, _Args...>, _Try, _Catch>, _Args...>;
};

template <class _Fn, class _Default>
using __with_default = __mtry_catch<_Fn, __mconst<_Default>>;

template <template <class...> class _Fn, class _Default>
using __with_default_q = __mtry_catch_q<_Fn, __mconst<_Default>>;

template <class _Fn, class _Default, class... _Args>
using __minvoke_or = __minvoke<__with_default<_Fn, _Default>, _Args...>;

template <template <class...> class _Fn, class _Default, class... _Args>
using __meval_or = __minvoke<__with_default_q<_Fn, _Default>, _Args...>;

template <template <class...> class _Fn>
struct __mtry_eval_ {
template <class... _Args>
Expand Down Expand Up @@ -640,8 +652,11 @@ namespace stdexec {
template <class... _As>
requires(sizeof...(_As) == 1)
using __msingle = __mfront<_As...>;
template <class _Ty>
using __msingle_or = __mbind_back_q<__mfront_, _Ty>;
template <class _Default, class... _As>
requires(sizeof...(_As) <= 1)
using __msingle_or_ = __mfront<_As..., _Default>;
template <class _Default>
using __msingle_or = __mbind_front_q<__msingle_or_, _Default>;

template <class _Continuation = __q<__types>>
struct __pop_front {
Expand Down
Loading

0 comments on commit 4eafc0d

Please sign in to comment.