Provides a RAII way to execute a bit of code upon the destruction of the object. More...
#include <ScopeExecutor.h>
Public Member Functions | |
ScopeExecutor (std::function< void()> execute) | |
Full initialisation constructor. | |
~ScopeExecutor () | |
Executes the supplied function. | |
Provides a RAII way to execute a bit of code upon the destruction of the object.
drn::foundation::ScopeExecutor::ScopeExecutor | ( | std::function< void()> | execute | ) |
Full initialisation constructor.
execute | The function that should be executed upon object destruction. The executable function must not throw. |
drn::foundation::ScopeExecutor::~ScopeExecutor | ( | ) |
Executes the supplied function.