Scope
 All Classes Functions Pages
scope::scope_fail< Fn > Class Template Reference

An exit handler for handling throwing cases. More...

#include <scope.hpp>

+ Inheritance diagram for scope::scope_fail< Fn >:
+ Collaboration diagram for scope::scope_fail< Fn >:

Detailed Description

template<typename Fn>
class scope::scope_fail< Fn >

An exit handler for handling throwing cases.

This will execute when an exception has been thrown in the same frame the scope was created in. You can manually disengage executing this handler by calling release.

When working in C++17 and above, you can use the automatic class type-deduction in order to create an instance of this:

auto guard = scope::scope_fail{[&]{
...
}};

When working in any C++11 or C++14, convenience functions are also added to perform this deduction for you:

auto guard = scope::make_scope_fail([&]{
...
});
Template Parameters
Fnthe function type for the scope to execute

Definition at line 634 of file scope.hpp.


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