Turi Create  4.0
turi::scoped_finally Class Reference

#include <core/util/try_finally.hpp>

Detailed Description

Class to use the garuanteed destructor call of a scoped variable to simulate a try...finally block. This is the standard C++ way of doing that.

Use:

When you want to ensure something is executed, even when exceptions are present, create a scoped_finally structure and add the appropriate cleanup functions to it. When this structure goes out of scope, either due to an exception or the code leaving that scope, these functions are executed.

This is useful for cleaning up locks, etc.

Definition at line 30 of file try_finally.hpp.


The documentation for this class was generated from the following file: