Generalized scope guard template This template provides the general behaviors required for more concrete instances of scope types.

Synopsis

Declared in <beman/scope/scope.hpp>

template<
    class ScopeExitFunc,
    class InvokeChecker,
    exception_during_construction_behaviour ConstructionExceptionBehavior>
class scope_guard<ScopeExitFunc, InvokeChecker, ConstructionExceptionBehavior>;

Member Functions

Name

Description

scope_guard [constructor] [deleted]

The constructor parameter exit_func in the following constructors shall be : ‐ a reference to a function ‐ or a reference to a function object([function.objects])

~scope_guard [destructor]

Destructor

operator= [deleted]

Assignment operators

invoke_checker

release

Template Parameters

Name

Description

ScopeExitFunction

callable function that is conditionally invoked at the end of the scope.

InvokeChecker

callable function that handles checking if callback should be called on scope exit.

ConstructionExceptionBehavior

callable function that defines the behavior if an exception occurs on the construction.