/* */ #ifndef _D_SINGLETON_HOLDER_H_ #define _D_SINGLETON_HOLDER_H_ namespace aria2 { template class SingletonHolder { private: static T _instance; SingletonHolder() {} public: ~SingletonHolder() {} static T& instance() { return _instance; } static void instance(T& instance) { _instance = instance; } }; template T SingletonHolder::_instance; } // namespace aria2 #endif // _D_SINGLETON_HOLDER_H_