QScopeGuard Class
Provides a scope guard for calling a function at the end of a scope. More...
| Header: | #include <QScopeGuard> |
| qmake: | QT += core |
| Since: | Qt 5.12 |
Detailed Description
Provides a scope guard for calling a function at the end of a scope.
QScopeGuard<F> is a class of which the sole purpose is to run the function f in its destructor. This is useful for guaranteeing your cleanup code is executed, whether the function is exited normally, exited early by a return statement, or exited by an exception.
Note: Exceptions are not supported. The callable shouldn't throw when executed, copied or moved.
See also QScopedValueRollback.