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

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

#include <scope.hpp>

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

Detailed Description

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

An exit handler for handling non-throwing cases.

This will execute as long as an exception has not 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_success{[&]{
...
}};

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_success([&]{
...
});
Template Parameters
Fnthe function type for the scope to execute

Definition at line 556 of file scope.hpp.


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