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 laterstd::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_ptron success:return std::exception_ptr();. A throw-only callable spells that return type explicitly.Inside a catch block,
defercaptures 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, callstd::current_exception()directly.deferapplies to exceptions only: no status expression can take anexception_ptr. To keep a failing status’s exception, usestore(&eptr).