30#include <seastar/util/modules.hh>
33#ifdef SEASTAR_DEFERRED_ACTION_REQUIRE_NOEXCEPT
34#define SEASTAR_DEFERRED_ACTION_NOEXCEPT noexcept
36#define SEASTAR_DEFERRED_ACTION_NOEXCEPT
39template <
typename Func>
40concept deferrable_action =
requires (Func func) {
41 { func() } SEASTAR_DEFERRED_ACTION_NOEXCEPT -> std::same_as<void>;
46template <
typename Func>
47requires deferrable_action<Func>
50 bool _cancelled =
false;
52 static_assert(std::is_nothrow_move_constructible_v<Func>,
"Func(Func&&) must be noexcept");
66 void cancel() { _cancelled =
true; }
70template <
typename Func>
71requires deferrable_action<Func>
Seastar API namespace.
Definition: abort_on_ebadf.hh:26