@@ -87,33 +87,33 @@ namespace stdexec {
8787 requires (sizeof ...(_Ts) - 1 > 3 ) // intentional unsigned wrap-around for sizeof...(Ts) is zero
8888 struct __tuple <_Idx, _Ts...> : __box<_Ts, _Is>... {
8989 template <class ... _Us>
90- static auto __convert_from (__tuple<_Idx, _Us...> &&__tup) -> __tuple {
90+ static constexpr auto __convert_from (__tuple<_Idx, _Us...> &&__tup) -> __tuple {
9191 return __tuple{
9292 {static_cast <_Us &&>(__tup.STDEXEC_CWG1835_TEMPLATE __box<_Us, _Is>::__value)}...};
9393 }
9494
9595 template <class ... _Us>
96- static auto __convert_from (__tuple<_Idx, _Us...> const &__tup) -> __tuple {
96+ static constexpr auto __convert_from (__tuple<_Idx, _Us...> const &__tup) -> __tuple {
9797 return __tuple{{__tup.STDEXEC_CWG1835_TEMPLATE __box<_Us, _Is>::__value}...};
9898 }
9999
100100 template <std::size_t _Np, class _Self >
101101 STDEXEC_ATTRIBUTE (host, device, always_inline)
102- static auto __get (_Self &&__self) noexcept
102+ static constexpr auto __get (_Self &&__self) noexcept
103103 -> decltype(__tup::__get<_Np>(static_cast <_Self &&>(__self))) {
104104 return __tup::__get<_Np>(static_cast <_Self &&>(__self));
105105 }
106106
107107 // clang-format off
108108 template <class _Fn , class _Self , class ... _Us>
109- STDEXEC_ATTRIBUTE (host, device, always_inline) static auto apply (_Fn &&__fn, _Self &&__self, _Us &&...__us)
109+ STDEXEC_ATTRIBUTE (host, device, always_inline) static constexpr auto apply (_Fn &&__fn, _Self &&__self, _Us &&...__us)
110110 STDEXEC_AUTO_RETURN(
111111 static_cast <_Fn &&>(__fn)(
112112 static_cast <_Us &&>(__us)...,
113113 static_cast<_Self &&>(__self).STDEXEC_CWG1835_TEMPLATE __box<_Ts, _Is>::__value...))
114114
115115 template <class _Fn, class _Self, class... _Us>
116- STDEXEC_ATTRIBUTE(host, device, always_inline) static auto for_each(_Fn &&__fn, _Self &&__self)
116+ STDEXEC_ATTRIBUTE(host, device, always_inline) static constexpr auto for_each(_Fn &&__fn, _Self &&__self)
117117 STDEXEC_AUTO_RETURN(
118118 (static_cast <void >(
119119 __fn (static_cast <_Self &&>(__self).STDEXEC_CWG1835_TEMPLATE __box<_Ts, _Is>::__value)),
@@ -145,34 +145,34 @@ namespace stdexec {
145145 STDEXEC_REPEAT (_N, STDEXEC_TUPLE_ELEM_DEFN) \
146146 \
147147 template <STDEXEC_EVAL (STDEXEC_TAIL, STDEXEC_REPEAT (_N, STDEXEC_TPARAM_OTHER_DEFN))> \
148- static auto __convert_from (__tuple<_Idx STDEXEC_REPEAT (_N, STDEXEC_TPARAM_OTHER_USE)> &&__tup) \
148+ static constexpr auto __convert_from (__tuple<_Idx STDEXEC_REPEAT (_N, STDEXEC_TPARAM_OTHER_USE)> &&__tup) \
149149 -> __tuple { \
150150 return __tuple{ \
151151 STDEXEC_EVAL (STDEXEC_TAIL, STDEXEC_REPEAT (_N, STDEXEC_TUPLE_OTHER_ELEM_RVALUE))}; \
152152 } \
153153 \
154154 template <STDEXEC_EVAL (STDEXEC_TAIL, STDEXEC_REPEAT (_N, STDEXEC_TPARAM_OTHER_DEFN))> \
155- static auto __convert_from ( \
155+ static constexpr auto __convert_from ( \
156156 __tuple<_Idx STDEXEC_REPEAT (_N, STDEXEC_TPARAM_OTHER_USE)> const &__tup) -> __tuple { \
157157 return __tuple{ \
158158 STDEXEC_EVAL (STDEXEC_TAIL, STDEXEC_REPEAT (_N, STDEXEC_TUPLE_OTHER_ELEM_LVALUE))}; \
159159 } \
160160 \
161161 template <std::size_t _Np, class _Self > \
162162 STDEXEC_ATTRIBUTE (host, device, always_inline) \
163- static auto __get (_Self &&__self) noexcept -> decltype (auto ) requires (_Np < _N) { \
163+ static constexpr auto __get (_Self &&__self) noexcept -> decltype (auto ) requires (_Np < _N) { \
164164 STDEXEC_REPEAT (_N, STDEXEC_TUPLE_GET_ELEM); \
165165 } \
166166 \
167167 template <class _Fn , class _Self , class ... _Us> \
168168 STDEXEC_ATTRIBUTE (host, device, always_inline) \
169- static auto apply (_Fn &&__fn, _Self &&__self, _Us &&...__us ) STDEXEC_AUTO_RETURN ( \
169+ static constexpr auto apply (_Fn &&__fn, _Self &&__self, _Us &&...__us ) STDEXEC_AUTO_RETURN ( \
170170 static_cast <_Fn &&>(__fn)(static_cast <_Us &&>(__us)... \
171171 STDEXEC_REPEAT (_N, STDEXEC_TUPLE_ELEM_USE))) \
172172 \
173173 template <class _Fn , class _Self > \
174174 STDEXEC_ATTRIBUTE (host, device, always_inline) \
175- static auto for_each (_Fn &&__fn, _Self &&__self) STDEXEC_AUTO_RETURN ( \
175+ static constexpr auto for_each (_Fn &&__fn, _Self &&__self) STDEXEC_AUTO_RETURN ( \
176176 STDEXEC_EVAL (STDEXEC_TAIL, STDEXEC_REPEAT (_N, STDEXEC_TUPLE_FOR_EACH_ELEM))) \
177177 };
178178 // clang-format on
@@ -209,15 +209,15 @@ namespace stdexec {
209209
210210 template <class _Fn , class _Tuple >
211211 STDEXEC_ATTRIBUTE (host, device, always_inline)
212- auto operator <<(_Tuple &&__tup, _Fn __fn) noexcept (__nothrow_move_constructible<_Fn>) {
212+ constexpr auto operator <<(_Tuple &&__tup, _Fn __fn) noexcept (__nothrow_move_constructible<_Fn>) {
213213 return [&__tup, __fn = static_cast <_Fn &&>(__fn)]<class ... _Us>(_Us &&...__us ) noexcept (
214214 __nothrow_applicable<_Fn, _Tuple, _Us...>) -> __apply_result_t <_Fn, _Tuple, _Us...> {
215215 return __tup.apply (__fn, static_cast <_Tuple &&>(__tup), static_cast <_Us &&>(__us)...);
216216 };
217217 }
218218
219219 template <class _Fn , class ... _Tuples>
220- auto __cat_apply (_Fn __fn, _Tuples &&...__tups)
220+ constexpr auto __cat_apply (_Fn __fn, _Tuples &&...__tups)
221221 STDEXEC_AUTO_RETURN((static_cast <_Tuples &&>(__tups) << ... << __fn)())
222222
223223 STDEXEC_PRAGMA_PUSH() STDEXEC_PRAGMA_IGNORE_GNU(" -Wmissing-braces" )
0 commit comments