openMSX
Main Page
Namespaces
Classes
Files
File List
File Members
utils
ScopedAssign.hh
Go to the documentation of this file.
1
#ifndef SCOPEDASSIGN_HH
2
#define SCOPEDASSIGN_HH
3
7
template
<
typename
T>
class
ScopedAssign
8
{
9
public
:
10
ScopedAssign
(T& var_, T newValue)
11
: var(var_)
12
{
13
oldValue = var;
14
var = newValue;
15
}
16
~ScopedAssign
()
17
{
18
var = oldValue;
19
}
20
private
:
21
T& var;
22
T oldValue;
23
};
24
25
#endif
Generated on Mon May 20 2013 12:17:00 for openMSX by
1.8.1.2