// Author: Vadim Zeitlin
// Modified by:
// Created: 03.07.2003
-// RCS-ID: $Id$
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
{
// empty class just to be able to define a reference to it
-class VariableSetterBase { };
+class VariableSetterBase : public wxScopeGuardImplBase { };
typedef const VariableSetterBase& VariableSetter;
{
}
- ~VariableSetterImpl()
- {
- m_var = m_value;
- }
+ ~VariableSetterImpl() { wxPrivateOnScopeExit(*this); }
+
+ void Execute() { m_var = m_value; }
private:
T& m_var;
{
}
- ~VariableNullerImpl()
- {
- m_var = NULL;
- }
+ ~VariableNullerImpl() { wxPrivateOnScopeExit(*this); }
+
+ void Execute() { m_var = NULL; }
private:
T& m_var;