|
tetl 0.1.0
Embedded Template Library
|
The class template scope_exit is a general-purpose scope guard intended to call its exit function when a scope is exited.
More...
#include <scope_exit.hpp>
The class template scope_exit is a general-purpose scope guard intended to call its exit function when a scope is exited.
A scope_exit may be either active, i.e. calls its exit function on destruction, or inactive, i.e. does nothing on destruction. A scope_exit is active after constructed from an exit function. A scope_exit can become inactive by calling release() on it either manually or automatically (by the move constructor). An inactive scope_exit may also be obtained by initializing with another inactive scope_exit. Once a scope_exit is inactive, it cannot become active again.