Public Member Functions

mozilla::AutoRestore< T > Class Template Reference

Save the current value of a variable and restore it when the object goes out of scope. More...

#include <AutoRestore.h>

List of all members.

Public Member Functions

 AutoRestore (T &aValue)
 ~AutoRestore ()

Detailed Description

template<class T>
class mozilla::AutoRestore< T >

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 }


Constructor & Destructor Documentation

template<class T >
mozilla::AutoRestore< T >::AutoRestore ( T &  aValue  )  [inline]
template<class T >
mozilla::AutoRestore< T >::~AutoRestore (  )  [inline]

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