@@ -285,7 +285,7 @@ namespace stdexec {
285285 // ! custom implementation of a sender algorithm.
286286 // !
287287 // ! @tparam _Tag one of set_value_t, set_error_t, or set_stopped_t
288- template <__completion_tag _Tag>
288+ template <class _Tag >
289289 struct get_completion_domain_t {
290290 template <class Sig >
291291 static inline constexpr get_completion_domain_t <_Tag> (*signature)(Sig) = nullptr ;
@@ -320,13 +320,15 @@ namespace stdexec {
320320 static consteval auto __check_domain (_Domain) noexcept -> _Domain {
321321 // Sanity check: if a completion scheduler can be determined from the attributes
322322 // (not the environment), then its domain must match the domain returned by the attributes.
323- if constexpr (__callable<get_completion_scheduler_t <_Tag>, const _Attrs&, const _Env&...>) {
324- using __sch_t =
325- __call_result_t <get_completion_scheduler_t <_Tag>, const _Attrs&, const _Env&...>;
326- // Skip check if the "scheduler" is the same as the domain or the attributes
327- // (this can happen with __prop_like which answers any query with the same type)
328- if constexpr (!__same_as<__sch_t , _Attrs>) {
329- __check_domain_<__sch_t , _Env...>(_Domain{});
323+ if constexpr (!__same_as<_Tag, void >) {
324+ if constexpr (__callable<get_completion_scheduler_t <_Tag>, const _Attrs&, const _Env&...>) {
325+ using __sch_t =
326+ __call_result_t <get_completion_scheduler_t <_Tag>, const _Attrs&, const _Env&...>;
327+ // Skip check if the "scheduler" is the same as the domain or the attributes
328+ // (this can happen with __prop_like which answers any query with the same type)
329+ if constexpr (!__same_as<__sch_t , _Attrs>) {
330+ __check_domain_<__sch_t , _Env...>(_Domain{});
331+ }
330332 }
331333 }
332334 return {};
@@ -338,6 +340,16 @@ namespace stdexec {
338340 if constexpr (__callable<__read_query_t , const _Attrs&, const _Env&...>) {
339341 using __domain_t = __call_result_t <__read_query_t , const _Attrs&, const _Env&...>;
340342 return __check_domain<_Attrs, _Env...>(__domain_t {});
343+ // Otherwise, if _Tag is void, fall back to querying for the set_value_t completion domain:
344+ } else if constexpr (__same_as<_Tag, void >) {
345+ if constexpr (
346+ __callable<get_completion_domain_t <set_value_t >, const _Attrs&, const _Env&...>) {
347+ using __domain_t =
348+ __call_result_t <get_completion_domain_t <set_value_t >, const _Attrs&, const _Env&...>;
349+ return __check_domain<_Attrs, _Env...>(__domain_t {});
350+ } else {
351+ return void ();
352+ }
341353 }
342354 // Otherwise, if __attrs has a completion scheduler, we can ask that scheduler for its
343355 // completion domain.
@@ -433,9 +445,11 @@ namespace stdexec {
433445 using __queries::get_domain_t ;
434446
435447#if !STDEXEC_GCC() || defined(__OPTIMIZE_SIZE__)
436- template <__completion_tag _Query >
437- inline constexpr get_completion_domain_t <_Query > get_completion_domain{};
448+ template <class _Tag >
449+ inline constexpr get_completion_domain_t <_Tag > get_completion_domain{};
438450#else
451+ template <>
452+ inline constexpr get_completion_domain_t <> get_completion_domain<>{};
439453 template <>
440454 inline constexpr get_completion_domain_t <set_value_t > get_completion_domain<set_value_t >{};
441455 template <>
0 commit comments