MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / __repeat_until_impl

Class __repeat_until_impl

include/exec/repeat_until.hpp:223–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221 };
222
223 struct __repeat_until_impl : __sexpr_defaults
224 {
225 static constexpr auto __get_attrs =
226 []<class _Child>(__ignore, __ignore, _Child const &__child) noexcept
227 -> __seq::__attrs<schedule_result_t<trampoline_scheduler>, _Child &>
228 {
229 return {STDEXEC::schedule(trampoline_scheduler{}), const_cast<_Child &>(__child)};
230 };
231
232 template <class _Child>
233 static constexpr auto __transform_values = []<class... _Args>()
234 {
235 if constexpr (sizeof...(_Args) != 1 || (!__std::convertible_to<_Args, bool> || ...))
236 {
237 return exec::throw_compile_time_error<
238 _WHAT_(_INVALID_ARGUMENT_),
239 _WHERE_(_IN_ALGORITHM_, repeat_until_t),
240 _WHY_(_EXPECTING_A_SENDER_OF_ONE_VALUE_THAT_IS_CONVERTIBLE_TO_BOOL_),
241 _WITH_PRETTY_SENDER_<_Child>>();
242 }
243 else if constexpr ((__is_bool_constant<_Args, false> && ...))
244 {
245 return STDEXEC::completion_signatures{};
246 }
247 else if constexpr ((std::is_nothrow_convertible_v<_Args, bool> && ...))
248 {
249 return STDEXEC::completion_signatures<set_value_t()>();
250 }
251 else
252 {
253 return STDEXEC::completion_signatures<set_value_t(), set_error_t(std::exception_ptr)>();
254 }
255 };
256
257 static constexpr auto __transform_errors = []<class _Error>() noexcept
258 {
259 if constexpr (__nothrow_decay_copyable<_Error> || __decays_to<_Error, std::exception_ptr>)
260 {
261 return STDEXEC::completion_signatures<set_error_t(_Error)>();
262 }
263 else
264 {
265 return STDEXEC::completion_signatures<set_error_t(_Error),
266 set_error_t(std::exception_ptr)>();
267 }
268 };
269
270 template <class _Sender, class... _Env>
271 static consteval auto __get_completion_signatures()
272 {
273 using __child_t = __child_of<_Sender>;
274 using __bouncer_t = schedule_result_t<trampoline_scheduler>;
275 using __eptr_completion_t = set_error_t(std::exception_ptr);
276 constexpr auto __eptr_completion = (__eptr_completion_t *) nullptr;
277
278 auto __sigs =
279 exec::transform_completion_signatures(get_completion_signatures<__child_t, _Env...>(),
280 __transform_values<__child_t>,

Callers

nothing calls this directly

Calls 2

scheduleFunction · 0.70
__opstateClass · 0.70

Tested by

no test coverage detected