![]() |
PIP 5.6.1
Platform-Independent Primitives
|
Class for executing a function upon scope exit. More...
#include <pibase.h>
Public Member Functions | |
| PIScopeExitCall (std::function< void()> f) | |
| Constructor that takes a function to execute. | |
| ~PIScopeExitCall () | |
| Destructor that executes the function if it exists. | |
| void | cancel () |
| Method for canceling the function. | |
| void | call () |
| Method for call the function. | |
| void | callAndCancel () |
| Method for call and canceling the function. | |
Class for executing a function upon scope exit.
Example
In this example "Error!" will be printed on every false function return.