FreeRDP
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
Functions
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
Functions
a
c
d
e
f
g
i
o
r
s
t
Variables
a
b
c
d
e
g
i
l
m
n
o
p
r
s
t
u
v
Files
File List
Globals
All
Typedefs
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Modules
Pages
Loading...
Searching...
No Matches
scoped_guard.hpp
1
21
#pragma once
22
23
#include <functional>
24
25
class
ScopeGuard
26
{
27
public
:
28
template
<
class
Callable>
explicit
ScopeGuard
(Callable&& cleanupFunction)
29
try
: f(std::forward<Callable>(cleanupFunction))
30
{
31
}
32
catch
(...)
33
{
34
cleanupFunction();
35
throw
;
36
}
37
38
~ScopeGuard
()
39
{
40
if
(f)
41
f();
42
}
43
44
void
dismiss()
noexcept
45
{
46
f =
nullptr
;
47
}
48
49
ScopeGuard
(
const
ScopeGuard
&) =
delete
;
50
ScopeGuard
(
ScopeGuard
&& other)
noexcept
=
delete
;
51
ScopeGuard
& operator=(
const
ScopeGuard
&) =
delete
;
52
ScopeGuard
& operator=(
const
ScopeGuard
&&) =
delete
;
53
54
private
:
55
std::function<void()> f;
56
};
25
class
ScopeGuard
{
…
};
ScopeGuard
Definition
scoped_guard.hpp:26
client
SDL
common
scoped_guard.hpp
Generated by
1.9.8