From 4eafc0d0bcf30fda09f269a0e9a54309492e0c9a Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Wed, 8 Nov 2023 16:11:57 -0800 Subject: [PATCH] domain information from the predecessor overrides that of the receiver --- include/exec/sequence/ignore_all_values.hpp | 2 +- include/exec/sequence_senders.hpp | 7 +- include/nvexec/stream/common.cuh | 2 +- include/stdexec/__detail/__meta.hpp | 55 +-- include/stdexec/execution.hpp | 317 +++++++++++------- test/stdexec/algos/adaptors/test_transfer.cpp | 24 +- .../algos/adaptors/test_transfer_when_all.cpp | 12 +- 7 files changed, 252 insertions(+), 167 deletions(-) diff --git a/include/exec/sequence/ignore_all_values.hpp b/include/exec/sequence/ignore_all_values.hpp index 9d0739840..67b084734 100644 --- a/include/exec/sequence/ignore_all_values.hpp +++ b/include/exec/sequence/ignore_all_values.hpp @@ -277,7 +277,7 @@ namespace exec { struct ignore_all_values_t { template 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(__(), (_Sender&&) __sndr)); } diff --git a/include/exec/sequence_senders.hpp b/include/exec/sequence_senders.hpp index b20d0fb03..b1486c8ec 100644 --- a/include/exec/sequence_senders.hpp +++ b/include/exec/sequence_senders.hpp @@ -135,7 +135,8 @@ namespace exec { namespace __sequence_sndr { struct get_item_types_t; template - 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 concept __with_tag_invoke = // @@ -328,7 +329,7 @@ namespace exec { template static constexpr auto __select_impl() noexcept { - using _Domain = __env_domain_of_t>; + using _Domain = __late_domain_of_t<_Sender, env_of_t<_Receiver&>>; constexpr bool _NothrowTfxSender = __nothrow_callable && __nothrow_callable>; @@ -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 && // STDEXEC_IS_BASE_OF( stream_sender_base, - __decay_t, S, E>>); + __decay_t, S, E>>); template concept stream_receiver = // diff --git a/include/stdexec/__detail/__meta.hpp b/include/stdexec/__detail/__meta.hpp index 5f141b08b..fc2c4929a 100644 --- a/include/stdexec/__detail/__meta.hpp +++ b/include/stdexec/__detail/__meta.hpp @@ -327,6 +327,12 @@ namespace stdexec { template struct __mdefer : __mdefer_<_Fn, _Args...> { }; + template + using __mmemoize = __t<__mdefer<_Fn, _Args...>>; + + template