12
12
13
13
namespace beman ::execution26::detail
14
14
{
15
- inline constexpr struct sender_any_t
16
- {
17
- template <typename T> constexpr operator T () const ;
18
- } sender_any;
19
-
20
15
template <typename Tag, typename Data, typename Children>
21
16
struct sender_meta
22
17
{
@@ -42,43 +37,38 @@ namespace beman::execution26::detail
42
37
return sender_meta<decltype(tag), decltype(data), ::std::tuple<decltype(children)...>>;
43
38
#endif
44
39
using sender_type = ::std::remove_cvref_t <Sender>;
45
- static constexpr ::beman::execution26::detail::sender_any_t at{};
46
- if constexpr (
47
- requires (){ sender_type{ at, at, at, at, at, at }; }
48
- || requires (){ sender_type{ { at, at, at, at, at, at } }; }
49
- )
40
+
41
+ if constexpr (requires (){
42
+ []{ auto &&[tag, data, c0, c1, c2, c3] = *static_cast <sender_type*>(nullptr ); };
43
+ })
50
44
{
51
45
auto && [tag, data, c0, c1, c2, c3] = sender;
52
46
return ::beman::execution26::detail::sender_meta<decltype (tag), decltype (data), ::std::tuple<decltype (c0), decltype (c1), decltype (c2), decltype (c3)>>{};
53
47
}
54
- else if constexpr (
55
- requires (){ sender_type{ at, at, at, at, at }; }
56
- || requires (){ sender_type{ { at, at, at, at, at } }; }
57
- )
48
+ else if constexpr (requires (){
49
+ []{ auto &&[tag, data, c0, c1, c2] = *static_cast <sender_type*>(nullptr ); };
50
+ })
58
51
{
59
52
auto && [tag, data, c0, c1, c2] = sender;
60
53
return ::beman::execution26::detail::sender_meta<decltype (tag), decltype (data), ::std::tuple<decltype (c0), decltype (c1), decltype (c2)>>{};
61
54
}
62
- else if constexpr (
63
- requires (){ sender_type{ at, at, at, at }; }
64
- || requires (){ sender_type{ { at, at, at, at } }; }
65
- )
55
+ else if constexpr (requires (){
56
+ []{ auto &&[tag, data, c0, c1] = *static_cast <sender_type*>(nullptr ); };
57
+ })
66
58
{
67
59
auto && [tag, data, c0, c1] = sender;
68
60
return ::beman::execution26::detail::sender_meta<decltype (tag), decltype (data), ::std::tuple<decltype (c0), decltype (c1)>>{};
69
61
}
70
- else if constexpr (
71
- requires (){ sender_type{ at, at, at }; }
72
- || requires (){ sender_type{ { at, at, at } }; }
73
- )
62
+ else if constexpr (requires (){
63
+ []{ auto &&[tag, data, c0] = *static_cast <sender_type*>(nullptr ); };
64
+ })
74
65
{
75
66
auto && [tag, data, c0] = sender;
76
67
return ::beman::execution26::detail::sender_meta<decltype (tag), decltype (data), ::std::tuple<decltype (c0)>>{};
77
68
}
78
- else if constexpr (
79
- requires (){ sender_type{ at, at }; }
80
- || requires (){ sender_type{ { at, at } }; }
81
- )
69
+ else if constexpr (requires (){
70
+ []{ auto &&[tag, data] = *static_cast <sender_type*>(nullptr ); };
71
+ })
82
72
{
83
73
auto && [tag, data] = sender;
84
74
return ::beman::execution26::detail::sender_meta<decltype (tag), decltype (data), ::std::tuple<>>{};
@@ -98,36 +88,46 @@ namespace beman::execution26::detail
98
88
return sender_meta<decltype(tag), decltype(data), ::std::tuple<decltype(children)...>>;
99
89
#endif
100
90
using sender_type = ::std::remove_cvref_t <Sender>;
101
- static constexpr ::beman::execution26::detail::sender_any_t at{};
102
- if constexpr (requires (){ sender_type{ at, at, at, at, at, at }; })
91
+
92
+ if constexpr (requires (){
93
+ []{ auto &&[tag, data, c0, c1, c2, c3] = *static_cast <sender_type*>(nullptr ); };
94
+ })
103
95
{
104
96
auto && [tag, data, c0, c1, c2, c3] = sender;
105
97
return ::beman::execution26::detail::sender_data<decltype (tag), decltype (data), decltype (::std::tie (c0, c1, c2, c3))>{
106
98
tag, data, ::std::tie (c0, c1, c2, c3)
107
99
};
108
100
}
109
- else if constexpr (requires (){ sender_type{ at, at, at, at, at }; })
101
+ else if constexpr (requires (){
102
+ []{ auto &&[tag, data, c0, c1, c2] = *static_cast <sender_type*>(nullptr ); };
103
+ })
110
104
{
111
105
auto && [tag, data, c0, c1, c2] = sender;
112
106
return ::beman::execution26::detail::sender_data<decltype (tag), decltype (data), decltype (::std::tie (c0, c1, c2))>{
113
107
tag, data, ::std::tie (c0, c1, c2)
114
108
};
115
109
}
116
- else if constexpr (requires (){ sender_type{ at, at, at, at }; })
110
+ else if constexpr (requires (){
111
+ []{ auto &&[tag, data, c0, c1] = *static_cast <sender_type*>(nullptr ); };
112
+ })
117
113
{
118
114
auto && [tag, data, c0, c1] = sender;
119
115
return ::beman::execution26::detail::sender_data<decltype (tag), decltype (data), decltype (::std::tie (c0, c1))>{
120
116
tag, data, ::std::tie (c0, c1)
121
117
};
122
118
}
123
- else if constexpr (requires (){ sender_type{ at, at, at }; })
119
+ else if constexpr (requires (){
120
+ []{ auto &&[tag, data, c0] = *static_cast <sender_type*>(nullptr ); };
121
+ })
124
122
{
125
123
auto && [tag, data, c0] = sender;
126
124
return ::beman::execution26::detail::sender_data<decltype (tag), decltype (data), decltype (::std::tie (c0))>{
127
125
tag, data, ::std::tie (c0)
128
126
};
129
127
}
130
- else if constexpr (requires (){ sender_type{ at, at }; })
128
+ else if constexpr (requires (){
129
+ []{ auto &&[tag, data] = *static_cast <sender_type*>(nullptr ); };
130
+ })
131
131
{
132
132
auto && [tag, data] = sender;
133
133
return ::beman::execution26::detail::sender_data<decltype (tag), decltype (data), ::std::tuple<>>{
0 commit comments