20using Alive = std::shared_ptr<bool>;
23using Weak = std::weak_ptr<bool>;
31 return [weak = std::move(alive), fn = std::move(fn)](
auto&&... args)
33 const Alive held = weak.lock();
36 fn(std::forward<
decltype(args)>(args)...);
Definition action_sheet.hpp:11
std::weak_ptr< bool > Weak
Definition guarded.hpp:23
std::shared_ptr< bool > Alive
Definition guarded.hpp:20
auto guarded(Weak alive, F fn)
Definition guarded.hpp:29
Alive make_alive()
Definition guarded.hpp:24