lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Auto restore class that automatically restores the initial value of the stored object on destruction. More...
#include <auto_restore.h>
Inherits noncopyable.
Public Types | |
typedef Value | value_type |
Type of the value managed by this class. | |
Public Member Functions | |
auto_restore (value_type &value) | |
Constructs an auto-restore object that will restore the given object's current value on destruction. | |
auto_restore (value_type &value, const value_type &newValue) | |
Constructs an auto-restore object that will assign the given value to the given object and restore the given object's current value on destruction. | |
~auto_restore () | |
Resets the stored object to its initial value. | |
LEAN_INLINE value_type & | get (void) |
Gets the object managed by this class. | |
LEAN_INLINE const value_type & | get (void) const |
Gets the object managed by this class. | |
LEAN_INLINE value_type & | operator* () |
Gets the object managed by this class. | |
LEAN_INLINE const value_type & | operator* () const |
Gets the object managed by this class. | |
LEAN_INLINE value_type * | operator-> () |
Gets the object managed by this class. | |
LEAN_INLINE const value_type * | operator-> () const |
Gets the object managed by this class. | |
LEAN_INLINE | operator value_type & () |
Gets the object managed by this class. | |
LEAN_INLINE | operator const value_type & () const |
Gets the object managed by this class. |
Auto restore class that automatically restores the initial value of the stored object on destruction.