|
30 | 30 | #include "__transform_completion_signatures.hpp" |
31 | 31 | #include "__transform_sender.hpp" |
32 | 32 | #include "__type_traits.hpp" |
33 | | -#include <type_traits> |
34 | 33 |
|
35 | 34 | namespace stdexec { |
36 | 35 | ///////////////////////////////////////////////////////////////////////////// |
37 | 36 | // [execution.get_completion_signatures] |
38 | 37 | namespace __detail { |
39 | 38 | struct __dependent_completions { }; |
40 | 39 |
|
| 40 | + using dependent_completions = _ERROR_<__detail::__dependent_completions>; |
| 41 | + |
| 42 | + template <class _Completions> |
| 43 | + concept __well_formed_completions_helper = |
| 44 | + __valid_completion_signatures<_Completions> || __same_as<_Completions, dependent_completions>; |
| 45 | + |
41 | 46 | template <class _Completions> |
42 | | - concept __well_formed_sender = __valid_completion_signatures<_Completions> |
43 | | - || __same_as<_Completions, _ERROR_<__dependent_completions>>; |
| 47 | + inline constexpr bool __well_formed_completions_v = |
| 48 | + __well_formed_completions_helper<_Completions>; |
| 49 | + |
| 50 | + template <class _Completions> |
| 51 | + concept __well_formed_completions = __well_formed_completions_v<_Completions>; |
44 | 52 | } // namespace __detail |
45 | 53 |
|
46 | | - using dependent_completions = _ERROR_<__detail::__dependent_completions>; |
| 54 | + using __detail::dependent_completions; |
47 | 55 |
|
48 | 56 | namespace __sigs { |
49 | 57 | template <class _Sender, class _Env> |
@@ -334,7 +342,7 @@ namespace stdexec { |
334 | 342 | ///////////////////////////////////////////////////////////////////////////// |
335 | 343 | // early sender type-checking |
336 | 344 | template <class _Sender> |
337 | | - concept __well_formed_sender = __detail::__well_formed_sender< |
| 345 | + concept __well_formed_sender = __detail::__well_formed_completions< |
338 | 346 | __minvoke<__with_default_q<__completion_signatures_of_t, dependent_completions>, _Sender>>; |
339 | 347 |
|
340 | 348 | // Used to report a meaningful error message when the sender_in<Sndr, Env> concept check fails. |
@@ -376,14 +384,16 @@ namespace stdexec { |
376 | 384 | !__merror<_Completions>, |
377 | 385 | "Trying to compute the sender's completion signatures resulted in an error. See the rest " |
378 | 386 | "of the compiler diagnostic for clues. Look for the string \"_ERROR_\"."); |
379 | | - // MSVC needs more encouragement to print the type of the error. |
380 | | - STDEXEC_MSVC(_Completions __what = 0;) |
381 | 387 | } else { |
382 | 388 | static_assert( |
383 | 389 | __valid_completion_signatures<_Completions>, |
384 | 390 | "The stdexec::sender_in<Sender, Environment> concept check has failed. This is likely a " |
385 | 391 | "bug in the sender implementation."); |
386 | 392 | } |
| 393 | +#if STDEXEC_MSVC() || STDEXEC_NVHPC() |
| 394 | + // MSVC and NVHPC need more encouragement to print the type of the error. |
| 395 | + _Completions __what = 0; |
| 396 | +#endif |
387 | 397 | } |
388 | 398 | } |
389 | 399 | } // namespace stdexec |
0 commit comments