21 std::shared_ptr<void> Guard_;
25 : Guard_ { nullptr, [f] (void*) { f (); } }
59 template<
typename F1,
typename F2>
60 requires std::is_same_v<F, DefaultScopeGuardDeleter>
64 [f1 = std::move (g1.F_), p1 = g1.Perform_, f2 = std::move (g2.F_), p2 = g2.Perform_]
72 , Perform_ { g1.Perform_ || g2.Perform_ }
87 Perform_ = other.Perform_;
88 other.Perform_ =
false;
94 , Perform_ { other.Perform_ }
96 other.Perform_ =
false;
124 throw std::logic_error {
"this scope guard has already been converted to a shared one" };
SharedScopeGuard(const F &f)
SharedScopeGuard(SharedScopeGuard &&)=default
SharedScopeGuard()=delete
SharedScopeGuard(const SharedScopeGuard &)=default
SharedScopeGuard Shared() &&
ScopeGuard(const ScopeGuard &)=delete
ScopeGuard(ScopeGuard &&other) noexcept
ScopeGuard(const F &f) noexcept
ScopeGuard< DefaultScopeGuardDeleter > EraseType()
ScopeGuard(ScopeGuard< F1 > &&g1, ScopeGuard< F2 > &&g2)
std::function< void()> DefaultScopeGuardDeleter
detail::ScopeGuard< F > MakeScopeGuard(const F &f)
Returns an object performing passed function on scope exit.
detail::ScopeGuard< detail::DefaultScopeGuardDeleter > DefaultScopeGuard