2525#include < exception> // IWYU pragma: keep for std::terminate
2626
2727namespace STDEXEC {
28+ namespace {
29+ template <auto _Descriptor>
30+ struct __sexpr ;
31+ } // namespace
32+
2833 namespace __detail {
2934 // A type that describes a sender's metadata
3035 template <class _Tag , class _Data , class ... _Child>
@@ -43,10 +48,17 @@ namespace STDEXEC {
4348
4449 template <class _Sender >
4550 using __desc_of = STDEXEC_REMOVE_REFERENCE(_Sender)::__desc_t ;
51+
52+ template <class _Sender >
53+ using __tag_of = __desc_of<_Sender>::__tag;
54+
55+ template <class _Sender >
56+ requires __mvalid<__tag_of, _Sender>
57+ extern __tag_of<_Sender> __tag_of_v;
4658 } // namespace __detail
4759
4860 template <class _Sender >
49- using tag_of_t = __detail::__desc_of <_Sender>::__tag ;
61+ using tag_of_t = decltype ( __detail::__tag_of_v <_Sender>) ;
5062
5163 template <class _Sender >
5264 using __data_of = __tuple_element_t <1 , _Sender>;
@@ -57,21 +69,26 @@ namespace STDEXEC {
5769 typename __detail::__desc_of<_Sender>::__children
5870 >;
5971
60- template <class _Ny , class _Sender >
61- using __nth_child_of = __children_of<_Sender, __mbind_front_q<__m_at, _Ny>>;
62-
6372 template <std::size_t _Ny, class _Sender >
64- using __nth_child_of_c = __children_of<_Sender, __mbind_front_q<__m_at, __msize_t <_Ny>> >;
73+ using __nth_child_of_c = __tuple_element_t <_Ny + 2 , _Sender >;
6574
66- template <class _Sender >
67- using __child_of = __children_of<_Sender, __q<__mfront> >;
75+ template <class _Ny , class _Sender >
76+ using __nth_child_of = __nth_child_of_c<_Ny::value, _Sender >;
6877
6978 template <class _Sender >
70- inline constexpr std:: size_t __nbr_children_of = __children_of<_Sender, __msize>::value ;
79+ using __child_of = __tuple_element_t < 2 , _Sender> ;
7180
7281 template <class _Sender >
73- requires __mvalid<tag_of_t , _Sender>
74- struct __muncurry_ <_Sender> : __detail::__desc_of<_Sender> { };
82+ inline constexpr std::size_t __nbr_children_of = __tuple_size_v<_Sender> - 2 ;
83+
84+ template <auto _Descriptor>
85+ struct __muncurry_ <__sexpr<_Descriptor>> : decltype (_Descriptor()){};
86+
87+ template <auto _Descriptor>
88+ struct __muncurry_ <__sexpr<_Descriptor> &> : decltype (_Descriptor()){};
89+
90+ template <auto _Descriptor>
91+ struct __muncurry_ <__sexpr<_Descriptor> const &> : decltype (_Descriptor()){};
7592
7693 template <class _Sender >
7794 concept sender_expr = __mvalid<tag_of_t , _Sender>;
0 commit comments