Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
CopyableValueRestorer< T > Struct Template Reference

#include <MemoryX.h>

Public Member Functions

 CopyableValueRestorer (T &var)
 
 CopyableValueRestorer (T &var, const T &newValue)
 

Public Attributes

std::shared_ptr< T > pointer
 

Detailed Description

template<typename T>
struct CopyableValueRestorer< T >

Like ValueRestorer but copy-constructible

Definition at line 238 of file MemoryX.h.

Constructor & Destructor Documentation

◆ CopyableValueRestorer() [1/2]

template<typename T >
CopyableValueRestorer< T >::CopyableValueRestorer ( T &  var)
inlineexplicit

Definition at line 239 of file MemoryX.h.

240 : pointer{ &var, RestoreValue<T>{ var } }
241 {}
std::shared_ptr< T > pointer
Definition: MemoryX.h:248
Structure used by ValueRestorer.
Definition: MemoryX.h:203

◆ CopyableValueRestorer() [2/2]

template<typename T >
CopyableValueRestorer< T >::CopyableValueRestorer ( T &  var,
const T &  newValue 
)
inline

Definition at line 242 of file MemoryX.h.

243 : pointer{ &var, RestoreValue<T>{ var } }
244 {
245 var = newValue;
246 }

Member Data Documentation

◆ pointer

template<typename T >
std::shared_ptr<T> CopyableValueRestorer< T >::pointer

Definition at line 248 of file MemoryX.h.


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