Index: core/include/fxcrt/fx_basic.h |
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h |
index 7412b8db3cd99d002325d4693b65a6ffd079fc6a..9ed5fbafcf334820bd08d48dff43a7cdf8e60dc8 100644 |
--- a/core/include/fxcrt/fx_basic.h |
+++ b/core/include/fxcrt/fx_basic.h |
@@ -936,15 +936,13 @@ class IFX_Pause { |
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 { |