cuda::experimental::stf::sump::effect_t#

template<class _F>
struct effect_t#

An effect: run a callable on the failure and decide nothing (answer void).

effect(f) is the general effect-only sink, of which notify and store are the named cases. f may take nothing, or the failure: on the exception channel a const std::exception* (null for a non-standard exception), on the code channel the status value. On its own the operation goes on (the default value, the status unchanged); inside & whatever follows decides. A throw from f forwards, as from any hook.

int level = 0;
auto evict = effect([&] { reclaim(place, -size, prereqs); ++level; });
((evict & retry) * 5 | unwind) ->* [&] { return allocator.allocate(place, size, prereqs); };

Public Functions

template<class _Fn>
inline void on_thrown(
const ::std::exception *__exception,
const ::cuda::std::source_location,
_Fn&
) noexcept(::cuda::std::is_nothrow_invocable_v<_F&, const ::std::exception*> || ::cuda::std::is_nothrow_invocable_v<_F&>)#
template<class _Status, class _Fn>
inline void on_returned(
const _Status __status,
const ::cuda::std::source_location,
_Fn&
) noexcept(::cuda::std::is_nothrow_invocable_v<_F&, _Status> || ::cuda::std::is_nothrow_invocable_v<_F&>)#