@@ -95,50 +95,45 @@ namespace STDEXEC {
9595 // ////////////////////////////////////////////////////////////////////////////////////////
9696 // get_completion_behavior: A sender can define this attribute to describe the sender's
9797 // completion behavior
98- namespace __queries {
99- template <__completion_tag _Tag>
100- struct get_completion_behavior_t {
101- private:
102- template <class _Attrs , class ... _Env>
103- STDEXEC_ATTRIBUTE (always_inline, host, device)
104- static constexpr auto __validate () noexcept {
105- using __result_t = __member_query_result_t <_Attrs, get_completion_behavior_t , _Env...>;
106- static_assert (
107- __nothrow_member_queryable_with<_Attrs, get_completion_behavior_t , _Env...>,
108- " The get_completion_behavior query must be noexcept." );
109- static_assert (
110- __std::convertible_to<__result_t , completion_behavior::behavior>,
111- " The get_completion_behavior query must return one of the static member variables in "
112- " execution::completion_behavior." );
113- return __result_t {};
114- }
98+ template <__completion_tag _Tag>
99+ struct get_completion_behavior_t {
100+ private:
101+ template <class _Attrs , class ... _Env>
102+ STDEXEC_ATTRIBUTE (always_inline, host, device)
103+ static constexpr auto __validate () noexcept {
104+ using __result_t = __member_query_result_t <_Attrs, get_completion_behavior_t , _Env...>;
105+ static_assert (
106+ __nothrow_member_queryable_with<_Attrs, get_completion_behavior_t , _Env...>,
107+ " The get_completion_behavior query must be noexcept." );
108+ static_assert (
109+ __std::convertible_to<__result_t , completion_behavior::behavior>,
110+ " The get_completion_behavior query must return one of the static member variables in "
111+ " execution::completion_behavior." );
112+ return __result_t {};
113+ }
115114
116- public:
117- template <class _Sig >
118- static inline constexpr get_completion_behavior_t (*signature)(_Sig) = nullptr;
115+ public:
116+ template <class _Sig >
117+ static inline constexpr get_completion_behavior_t (*signature)(_Sig) = nullptr;
119118
120- template <class _Attrs , class ... _Env>
121- STDEXEC_ATTRIBUTE (nodiscard, always_inline, host, device)
122- constexpr auto operator ()(const _Attrs&, const _Env&...) const noexcept {
123- if constexpr (
124- __member_queryable_with<const _Attrs&, get_completion_behavior_t <_Tag>, _Env...>) {
125- return __validate<_Attrs, _Env...>();
126- } else if constexpr (__member_queryable_with<
127- const _Attrs&,
128- get_completion_behavior_t <_Tag>
129- >) {
130- return __validate<_Attrs>();
131- } else {
132- return completion_behavior::unknown;
133- }
119+ template <class _Attrs , class ... _Env>
120+ STDEXEC_ATTRIBUTE (nodiscard, always_inline, host, device)
121+ constexpr auto operator ()(const _Attrs&, const _Env&...) const noexcept {
122+ if constexpr (
123+ __member_queryable_with<const _Attrs&, get_completion_behavior_t <_Tag>, _Env...>) {
124+ return __validate<_Attrs, _Env...>();
125+ } else if constexpr (__member_queryable_with<const _Attrs&, get_completion_behavior_t <_Tag>>) {
126+ return __validate<_Attrs>();
127+ } else {
128+ return completion_behavior::unknown;
134129 }
130+ }
135131
136- STDEXEC_ATTRIBUTE (nodiscard, always_inline, host, device)
137- static constexpr auto query (forwarding_query_t ) noexcept -> bool {
138- return true ;
139- }
140- };
141- } // namespace __queries
132+ STDEXEC_ATTRIBUTE (nodiscard, always_inline, host, device)
133+ static constexpr auto query (forwarding_query_t ) noexcept -> bool {
134+ return true ;
135+ }
136+ };
142137
143138 [[deprecated(" use STDEXEC::completion_behavior::weakest instead" )]]
144139 inline constexpr const auto & min = completion_behavior::weakest;
0 commit comments