File tree Expand file tree Collapse file tree 3 files changed +24
-5
lines changed
test/stdexec/algos/adaptors Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,9 @@ namespace STDEXEC
8383 STDEXEC_TRY
8484 {
8585 STDEXEC::set_value (static_cast <_State&&>(__state).__rcvr_ ,
86- __variant_t {
87- std::tuple<_Args&&...>{static_cast <_Args&&>(__args)...}});
86+ __variant_t {std::in_place_type<__decayed_std_tuple<_Args...>>,
87+ std::tuple<_Args&&...>{
88+ static_cast <_Args&&>(__args)...}});
8889 }
8990 STDEXEC_CATCH_ALL
9091 {
Original file line number Diff line number Diff line change @@ -56,6 +56,16 @@ namespace STDEXEC
5656
5757 struct when_all_with_variant_t
5858 {
59+ private:
60+ static constexpr auto __mk_transform_fn () noexcept
61+ {
62+ return []<class ... _Child>(__ignore, __ignore, _Child&&... __child)
63+ {
64+ return when_all (into_variant (static_cast <_Child&&>(__child))...);
65+ };
66+ }
67+
68+ public:
5969 template <sender... _Senders>
6070 constexpr auto operator ()(_Senders&&... __sndrs) const -> __well_formed_sender auto
6171 {
@@ -66,9 +76,7 @@ namespace STDEXEC
6676 static constexpr auto transform_sender (set_value_t , _Sender&& __sndr, __ignore)
6777 {
6878 // transform when_all_with_variant(sndrs...) into when_all(into_variant(sndrs)...).
69- return __apply ([&]<class ... _Child>(__ignore, __ignore, _Child&&... __child)
70- { return when_all (into_variant (static_cast <_Child&&>(__child))...); },
71- static_cast <_Sender&&>(__sndr));
79+ return __apply (__mk_transform_fn (), static_cast <_Sender&&>(__sndr));
7280 }
7381 };
7482
Original file line number Diff line number Diff line change 1515 */
1616
1717#include < catch2/catch.hpp>
18+ #include < exec/any_sender_of.hpp>
1819#include < exec/async_scope.hpp>
1920#include < exec/env.hpp>
2021#include < exec/sender_for.hpp>
@@ -461,4 +462,13 @@ namespace
461462 scope.request_stop ();
462463 ex::sync_wait (scope.on_empty ());
463464 }
465+
466+ TEST_CASE (" regression test for #1988" , " [adaptors][when_all" )
467+ {
468+ // just test that this compiles:
469+ using any_sender = exec::any_sender<
470+ exec::any_receiver<ex::completion_signatures<ex::set_value_t (int ), ex::set_value_t (double )>>>;
471+ ex::sync_wait (ex::when_all_with_variant (any_sender{ex::just (1 )}));
472+ SUCCEED ();
473+ }
464474} // namespace
You can’t perform that action at this time.
0 commit comments