NVIDIA/stdexec

The type derived from `_ERROR_` should not be considered as `__msuccess`

yanminhui opened this issue · 0 comments

template <class>
extern __msuccess __ok_v;
template <class _What, class... _With>
extern _ERROR_<_What, _With...> __ok_v<__mexception<_What, _With...>>;

Use overload instead of specialization:

consteval __msuccess __get_ok_type(...);

template <class What, class... With>
consteval _ERROR_<What, With...> __get_ok_type(const _ERROR_<What, With...>*);

template <class _Ty>
extern decltype(__get_ok_type((_Ty*)nullptr)) __ok_v; // Use overload instead of specialization

Use case: https://godbolt.org/z/P1eGccsEY