Save the current value of a variable and restore it when the object goes out of scope. More...
#include <AutoRestore.h>
Public Member Functions | |
| AutoRestore (T &aValue) | |
| ~AutoRestore () | |
Save the current value of a variable and restore it when the object goes out of scope.
For example: { AutoRestore<PRBool> savePainting(mIsPainting); mIsPainting = PR_TRUE;
// ... your code here ...
// mIsPainting is reset to its old value at the end of this block }
| mozilla::AutoRestore< T >::AutoRestore | ( | T & | aValue | ) | [inline] |
| mozilla::AutoRestore< T >::~AutoRestore | ( | ) | [inline] |
1.7.1