cuda::experimental::stf::sump::defer_t#

struct defer_t#

Capturing policy: on a throw, answers with the active std::exception_ptr, ready for storage and a later std::rethrow_exception.

This is the policy for boundaries that must not unwind but cannot decide either – the exception’s fate is somebody else’s, later.

The callable owns the expression type, so it must return std::exception_ptr on success: return std::exception_ptr();. A throw-only callable spells that return type explicitly.

Inside a catch block, defer captures the exception thrown by its own guarded body (the newest exception, current inside its own catch), never the exception the surrounding handler is handling; for that one, call std::current_exception() directly.

defer applies to exceptions only: no status expression can take an exception_ptr. To keep a failing status’s exception, use store(&eptr).

Public Functions

template<class _Fn>
inline ::std::exception_ptr on_thrown(
const ::std::exception*,
const ::cuda::std::source_location,
_Fn&
) const noexcept#

Captures the in-flight exception; the answer converts to the expression’s type.