diff options
Diffstat (limited to 'core/include/fxcrt/fx_basic.h')
-rw-r--r-- | core/include/fxcrt/fx_basic.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 62d2a09476..b85d737327 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -1065,15 +1065,13 @@ class CFX_DataFilter { template <typename T> class CFX_AutoRestorer { public: - explicit CFX_AutoRestorer(T* location) { - m_Location = location; - m_OldValue = *location; - } + explicit CFX_AutoRestorer(T* location) + : m_Location(location), m_OldValue(*location) {} ~CFX_AutoRestorer() { *m_Location = m_OldValue; } private: - T* m_Location; - T m_OldValue; + T* const m_Location; + const T m_OldValue; }; struct FxFreeDeleter { |