roar
Loading...
Searching...
No Matches
scope_exit.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <utility>
5
6namespace Roar
7{
8 template <typename EF>
10 {
11 public:
12 ScopeExit(EF&& func)
13 : onExit_(std::forward<EF>(func))
14 {}
16 {
17 onExit_();
18 }
19
20 private:
21 std::function<void()> onExit_;
22 };
23 template <typename T>
25}
Definition scope_exit.hpp:10
ScopeExit(EF &&func)
Definition scope_exit.hpp:12
std::function< void()> onExit_
Definition scope_exit.hpp:21
~ScopeExit()
Definition scope_exit.hpp:15
Definition authorization.hpp:10