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 235 of file MemoryX.h.

Constructor & Destructor Documentation

◆ CopyableValueRestorer() [1/2]

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

Definition at line 236 of file MemoryX.h.

237 : pointer{ &var, RestoreValue<T>{ var } }
238 {}
std::shared_ptr< T > pointer
Definition: MemoryX.h:245
Structure used by ValueRestorer.
Definition: MemoryX.h:200

◆ CopyableValueRestorer() [2/2]

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

Definition at line 239 of file MemoryX.h.

240 : pointer{ &var, RestoreValue<T>{ var } }
241 {
242 var = newValue;
243 }

Member Data Documentation

◆ pointer

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

Definition at line 245 of file MemoryX.h.


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