//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, SH Software Co. Ltd. // = FileName : XPushMemVar.h // = Version : ver2.0 // = Author : zjq // = CreateDate : 2002-09-09 // = Description: ÀàµÄÉùÃ÷ // = Maintainers: // //-----------------------------------------------------------------------------+ #ifndef _XPushMemVar_H_ #define _XPushMemVar_H_ template class XPushMemVar { public: XPushMemVar(T &var, const T &val); ~XPushMemVar() ; protected: T *m_pVarBackup; T m_valBackup; }; template XPushMemVar::XPushMemVar(T &var, const T &val) { m_pVarBackup = &var; m_valBackup = var; var = val; } template XPushMemVar::~XPushMemVar() { *m_pVarBackup = m_valBackup; } #endif