Date: 03/12/09 (Code WTF) Keywords: no keywords .h: #ifndef __TIMESTEPCONSTANT_H__ #define __TIMESTEPCONSTANT_H__ #include "../Common/stdex/singleton.h" class CTimeStepConstant { public: DWORD GetTimeStepSeconds(); }; typedef stdex::singleton< CTimeStepConstant > TimeStep; #endif // __TIMESTEPCONSTANT_H__
.cpp: #include "stdafx.h" #include "TimeStepConstant.h" namespace { const DWORD g_dwTimeStepSeconds = 60; } DWORD CTimeStepConstant::GetTimeStepSeconds() { return g_dwTimeStepSeconds; } Source: http://community.livejournal.com/code_wtf/161003.html
|