powerd++  0.4.4
Public Member Functions | Private Attributes | List of all members
anonymous_namespace{libloadplay.cpp}::Hold< T > Class Template Reference

Sets a referenced variable to a given value and restores it when going out of context. More...

Public Member Functions

 Hold (T &ref, T const value)
 The constructor sets the referenced variable to the given value. More...
 
 ~Hold ()
 Restores the original value.
 

Private Attributes

const T restore
 The original value.
 
T & ref
 Reference to the variable.
 

Detailed Description

template<typename T>
class anonymous_namespace{libloadplay.cpp}::Hold< T >

Sets a referenced variable to a given value and restores it when going out of context.

Template Parameters
TThe type of the value to hold

Constructor & Destructor Documentation

◆ Hold()

template<typename T >
anonymous_namespace{libloadplay.cpp}::Hold< T >::Hold ( T &  ref,
T const  value 
)
inline

The constructor sets the referenced variable to the given value.

Parameters
refThe variable to hold and restore
valueThe value to set the variable to

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