@@ -31,76 +31,53 @@ namespace exec {
3131 using __t = __basic_sequence_sender;
3232 };
3333
34- template <auto _DescriptorFn, class = STDEXEC::__anon>
35- struct __seqexpr {
36- using sender_concept = sequence_sender_t ;
37- using __t = __seqexpr;
38- using __id = __seqexpr;
39- using __desc_t = decltype (_DescriptorFn());
40- using __tag_t = __desc_t ::__tag;
41- using __captures_t =
42- STDEXEC::__minvoke<__desc_t , STDEXEC::__q<STDEXEC::__detail::__captures_t >>;
43-
44- static constexpr auto __tag () noexcept -> __tag_t {
45- return {};
46- }
47-
48- mutable __captures_t __impl_;
34+ namespace {
35+ template <auto _DescriptorFn>
36+ struct __seqexpr
37+ : STDEXEC::__minvoke<decltype (_DescriptorFn()), STDEXEC::__qq<STDEXEC::__tuple>> {
38+ using sender_concept = sequence_sender_t ;
39+ using __t = __seqexpr;
40+ using __id = __seqexpr;
41+ using __desc_t = decltype (_DescriptorFn());
42+ using __tag_t = __desc_t ::__tag;
43+
44+ static constexpr auto __tag () noexcept -> __tag_t {
45+ return {};
46+ }
47+
48+ template <class _Self = __seqexpr>
49+ auto get_env () const noexcept -> decltype(_Self::__tag().get_env(*this )) {
50+ static_assert (noexcept (_Self::__tag ().get_env (*this )));
51+ return _Self::__tag ().get_env (*this );
52+ }
53+
54+ template <class _Self , class ... _Env>
55+ static consteval auto get_completion_signatures () {
56+ static_assert (STDEXEC::__decays_to_derived_from<_Self, __seqexpr>);
57+ return __tag_t ::template get_completion_signatures<_Self, _Env...>();
58+ }
59+
60+ template <class _Self , class ... _Env>
61+ static consteval auto get_item_types () {
62+ static_assert (STDEXEC::__decays_to_derived_from<_Self, __seqexpr>);
63+ return __tag_t ::template get_item_types<_Self, _Env...>();
64+ }
65+
66+ template <class _Self , STDEXEC::receiver _Receiver>
67+ static auto subscribe (_Self&& __self, _Receiver&& __rcvr) noexcept (noexcept (
68+ __self.__tag().subscribe(static_cast <_Self&&>(__self), static_cast<_Receiver&&>(__rcvr))))
69+ -> decltype(__self.__tag()
70+ .subscribe(static_cast <_Self&&>(__self), static_cast<_Receiver&&>(__rcvr))) {
71+ static_assert (STDEXEC::__decays_to_derived_from<_Self, __seqexpr>);
72+ return __tag_t::subscribe (static_cast <_Self&&>(__self), static_cast <_Receiver&&>(__rcvr));
73+ }
74+ };
4975
5076 template <class _Tag , class _Data , class ... _Child>
5177 STDEXEC_ATTRIBUTE (host, device)
52- explicit __seqexpr (_Tag, _Data&& __data, _Child&&... __child)
53- : __impl_(
54- STDEXEC::__detail::__captures (
55- _Tag (),
56- static_cast<_Data&&>(__data),
57- static_cast<_Child&&>(__child)...)) {
58- }
59-
60- template <STDEXEC::__std::same_as<__seqexpr> _Self = __seqexpr>
61- auto get_env () const noexcept -> decltype(_Self::__tag().get_env(*this )) {
62- static_assert (noexcept (_Self::__tag ().get_env (*this )));
63- return _Self::__tag ().get_env (*this );
64- }
65-
66- template <STDEXEC::__decays_to_derived_from<__seqexpr> _Self, class ... _Env>
67- static consteval auto get_completion_signatures () {
68- return __tag_t ::template get_completion_signatures<_Self, _Env...>();
69- }
70-
71- template <STDEXEC::__decays_to_derived_from<__seqexpr> _Self, class ... _Env>
72- static consteval auto get_item_types () {
73- return __tag_t ::template get_item_types<_Self, _Env...>();
74- }
75-
76- template <STDEXEC::__decays_to_derived_from<__seqexpr> _Self, STDEXEC::receiver _Receiver>
77- static auto subscribe (_Self&& __self, _Receiver&& __rcvr) noexcept (noexcept (
78- __self.__tag().subscribe(static_cast <_Self&&>(__self), static_cast<_Receiver&&>(__rcvr))))
79- -> decltype(__self.__tag()
80- .subscribe(static_cast <_Self&&>(__self), static_cast<_Receiver&&>(__rcvr))) {
81- return __tag_t::subscribe (static_cast <_Self&&>(__self), static_cast <_Receiver&&>(__rcvr));
82- }
83-
84- template <class _Sequence , class _ApplyFn >
85- static auto apply (_Sequence&& __sequence, _ApplyFn&& __fun)
86- noexcept (STDEXEC::__nothrow_callable<
87- STDEXEC::__detail::__impl_of<_Sequence>,
88- STDEXEC::__copy_cvref_fn<_Sequence>,
89- _ApplyFn
90- >)
91- -> STDEXEC::__call_result_t<
92- STDEXEC::__detail::__impl_of<_Sequence>,
93- STDEXEC::__copy_cvref_fn<_Sequence>,
94- _ApplyFn
95- > {
96- return static_cast <_Sequence&&>(__sequence)
97- .__impl_ (STDEXEC::__copy_cvref_fn<_Sequence>(), static_cast <_ApplyFn&&>(__fun));
98- }
99- };
100-
101- template <class _Tag , class _Data , class ... _Child>
102- STDEXEC_ATTRIBUTE (host, device)
103- __seqexpr(_Tag, _Data, _Child...) -> __seqexpr<STDEXEC_SEXPR_DESCRIPTOR(_Tag, _Data, _Child...)>;
78+ __seqexpr (_Tag, _Data, _Child...)
79+ -> __seqexpr<STDEXEC_SEXPR_DESCRIPTOR(_Tag, _Data, _Child...)>;
80+ } // namespace
10481
10582 template <class _Tag , class _Data , class ... _Child>
10683 using __seqexpr_t = __seqexpr<STDEXEC_SEXPR_DESCRIPTOR(_Tag, _Data, _Child...)>;
0 commit comments