46 std::shared_ptr<void> Guard_;
50 : Guard_ {
nullptr, [f] (
void*) { f (); } }
89 Perform_ = other.Perform_;
90 other.Perform_ =
false;
96 , Perform_ { other.Perform_ }
98 other.Perform_ =
false;
126 throw std::logic_error {
"this scope guard has already been converted to a shared one" };
ScopeGuard & operator=(const ScopeGuard &)=delete
ScopeGuard< DefaultScopeGuardDeleter > EraseType()
detail::ScopeGuard< F > MakeScopeGuard(const F &f)
Returns an object performing passed function on scope exit.
SharedScopeGuard Shared()
ScopeGuard(const F &f) noexcept
std::function< void()> DefaultScopeGuardDeleter
SharedScopeGuard & operator=(const SharedScopeGuard &)=default
SharedScopeGuard(const F &f)
ScopeGuard(ScopeGuard &&other) noexcept