cuda::experimental::stf::sump::thrown#
-
template<class _E = ::std::exception, class _X>
auto cuda::experimental::stf::sump::thrown( - _X &&__x
The exception channel, as a selector or as a conversion.
Given a policy,
thrown(p)appliespto exceptions only and forwards a failing status. For a callable that can fail both ways, it pairs with returned, as inreturned(subst(cudaSuccess)) | thrown(notify & fwd). Such a policy is built for that callable: on a bare status operand thethrownarm can never match, which is a compile error (a type selector on a status), so the same policy variable cannot be reused there.Given a function,
thrown<E>(f)converts: for an exception matchingEby catch-clause rules (same or publicly derived), the answer isf(e), withethe caughtconst E&; anything else forwards. A value substitutes,voidis Nothing,nullvalnever returns, and a throw fromfreplaces the exception.Edefaults tostd::exception:thrown<cuda_exception>([](const cuda_exception& e) { return e.status<cudaError_t>(); }) | thrown([](const std::exception&) { return cudaErrorUnknown; })
- Parameters:
__x – [in] The policy, or the function taking
const E&.- Returns:
The selector or converter policy.