diff --git a/include/stdexec/__detail/__inline_scheduler.hpp b/include/stdexec/__detail/__inline_scheduler.hpp index 6f4540cba..e11cefff2 100644 --- a/include/stdexec/__detail/__inline_scheduler.hpp +++ b/include/stdexec/__detail/__inline_scheduler.hpp @@ -84,5 +84,5 @@ namespace STDEXEC constexpr auto operator==(inline_scheduler const &) const noexcept -> bool = default; }; - static_assert(__is_scheduler_affine>); + static_assert(__completes_inline>>); } // namespace STDEXEC diff --git a/include/stdexec/__detail/__queries.hpp b/include/stdexec/__detail/__queries.hpp index 77942078d..3dd58b7e1 100644 --- a/include/stdexec/__detail/__queries.hpp +++ b/include/stdexec/__detail/__queries.hpp @@ -47,87 +47,10 @@ namespace STDEXEC inline constexpr get_await_completion_adaptor_t get_await_completion_adaptor{}; - // NOT TO SPEC: - struct __is_scheduler_affine_t - { - template - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - static consteval auto __ensure_bool_constant() noexcept - { - if constexpr (__is_bool_constant<_Result>) - { - return static_cast(_Result::value); - } - else - { - static_assert(__is_bool_constant<_Result>, - "The __is_scheduler_affine query must be one of the following forms:\n" - " static constexpr bool query(__is_scheduler_affine_t) noexcept;\n" - " bool_constant query(__is_scheduler_affine_t) const noexcept;\n" - " bool_constant query(__is_scheduler_affine_t, const Env&) const " - "noexcept;\n"); - } - } - - template - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - consteval auto operator()() const noexcept -> bool - { - return __completes_where_it_starts; - } - - template <__queryable_with<__is_scheduler_affine_t> _Attrs, class... _Env> - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - consteval auto operator()() const noexcept -> bool - { - if constexpr (__statically_queryable_with<_Attrs, __is_scheduler_affine_t>) - { - return _Attrs::query(__is_scheduler_affine_t()); - } - else - { - return __ensure_bool_constant<__query_result_t<_Attrs, __is_scheduler_affine_t>>(); - } - } - - template - requires __queryable_with<_Attrs, __is_scheduler_affine_t, _Env const &> - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - consteval auto operator()() const noexcept -> bool - { - using __result_t = __query_result_t<_Attrs, __is_scheduler_affine_t, _Env const &>; - return __ensure_bool_constant<__result_t>(); - } - - template - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - consteval auto operator()(_Attrs const &, _Env const &...) const noexcept -> bool - { - return operator()<_Attrs, _Env...>(); - } - - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - static consteval auto query(forwarding_query_t) noexcept -> bool - { - return false; - } - }; - - template - concept __is_scheduler_affine = requires { - requires __is_scheduler_affine_t().operator(), _Env...>(); - }; - // The attributes of a sender adaptor that does not introduce asynchrony. template struct __sync_attrs { - [[nodiscard]] - constexpr auto query(__is_scheduler_affine_t) const noexcept - { - return __mbool<__is_scheduler_affine<_Sender>>(); - } - template [[nodiscard]] constexpr auto query(__get_completion_behavior_t<_Tag>, _Env const &...) const noexcept diff --git a/test/stdexec/algos/adaptors/test_then.cpp b/test/stdexec/algos/adaptors/test_then.cpp index 4292eb7ea..e8c87dc2d 100644 --- a/test/stdexec/algos/adaptors/test_then.cpp +++ b/test/stdexec/algos/adaptors/test_then.cpp @@ -24,8 +24,8 @@ namespace ex = STDEXEC; -// Check that the `then` algorithm is correctly forwarding the __is_scheduler_affine query -static_assert(ex::__is_scheduler_affine); +// Check that the `then` algorithm is correctly forwarding the __get_completion_behavior +// query: static_assert( ex::__completes_inline); diff --git a/test/stdexec/algos/factories/test_read.cpp b/test/stdexec/algos/factories/test_read.cpp index b8d43f40d..ef45530fa 100644 --- a/test/stdexec/algos/factories/test_read.cpp +++ b/test/stdexec/algos/factories/test_read.cpp @@ -31,6 +31,6 @@ namespace static_assert(ex::sender); static_assert(!ex::sender_in); static_assert(ex::sender_in); - static_assert(ex::__is_scheduler_affine); + static_assert(ex::__completes_inline, Env>); } } // namespace