@@ -541,50 +541,15 @@ namespace STDEXEC
541541 __cmplsigs::__partitions_of_t <_Sigs>::__count_stopped::value;
542542 } // namespace __detail
543543
544- // Below is the definition of the STDEXEC_TRY_LET portability macro. It is used to check
544+ // Below is the definition of the STDEXEC_IF_OK portability macro. It is used to check
545545 // that an expression's type is not an __mexception type.
546- //
547- // USAGE:
548- //
549- // STDEXEC_TRY_LET([constexpr]opt auto c, <expression>)
550- // {
551- // // c is guaranteed to not be an instantiation of __mexception.
552- // }
553- //
554- // When constexpr exceptions are available (C++26), the macro simply expands to the
555- // moral equivalent of:
556- //
557- // // With constexpr exceptions:
558- // auto c = <expression>; // throws if c is an __mexception type
559- //
560- // When constexpr exceptions are not available, the macro expands to:
561- //
562- // // Without constexpr exceptions:
563- // if constexpr (auto c = <expression>; __merror<decltype(c)>)
564- // {
565- // return c;
566- // }
567- // else
568546
569547#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS()
570548
571- # define STDEXEC_EAT_AUTO_auto
572- # define STDEXEC_EAT_CONSTEXPR_constexpr
573- # define STDEXEC_EAT_CONSTEXPR (_ID ) STDEXEC_EAT_CONSTEXPR_ ## _ID
574-
575- # define STDEXEC_PROBE_CONSTEXPR_constexpr STDEXEC_PP_PROBE (~, 1 )
576- # define STDEXEC_TRY_LET_ID (_ID ) \
577- STDEXEC_PP_CAT ( \
578- STDEXEC_EAT_AUTO_, \
579- STDEXEC_PP_IIF ( \
580- STDEXEC_PP_CHECK (STDEXEC_PROBE_CONSTEXPR_ ## _ID), \
581- STDEXEC_EAT_CONSTEXPR, \
582- STDEXEC_PP_EXPAND)(_ID))
583-
584- # define STDEXEC_TRY_LET (_ID, ...) \
585- if constexpr ([[maybe_unused]] _ID = __VA_ARGS__; __merror<decltype (STDEXEC_TRY_LET_ID(_ID))>) \
586- { \
587- return STDEXEC_TRY_LET_ID (_ID); \
549+ # define STDEXEC_IF_OK (_ID ) \
550+ if constexpr (STDEXEC::__merror<decltype (_ID)>) \
551+ { \
552+ return _ID; \
588553 } else
589554
590555 template <class , class _Sndr >
@@ -603,10 +568,7 @@ namespace STDEXEC
603568
604569#else // ^^^ no constexpr exceptions ^^^ / vvv constexpr exceptions vvv
605570
606- # define STDEXEC_TRY_LET (_ID, ...) \
607- if constexpr ([[maybe_unused]] _ID = __VA_ARGS__; false ) \
608- { \
609- } else
571+ # define STDEXEC_IF_OK (_ID )
610572
611573 template <class _Result , class _Sndr >
612574 [[noreturn, nodiscard]]
0 commit comments