Created
July 1, 2014 18:53
-
-
Save Naios/842f734e0952134c1c96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef Singleton_h | |
#define Singleton_h | |
#include <boost/serialization/singleton.hpp> | |
template <class SINGLETON_CLASS> | |
class Singleton | |
{ | |
public: | |
inline static SINGLETON_CLASS& instance() | |
{ | |
return boost::serialization::singleton<SINGLETON_CLASS>::get_mutable_instance(); | |
} | |
inline static SINGLETON_CLASS const& const_instance() | |
{ | |
return boost::serialization::singleton<SINGLETON_CLASS>::get_instance(); | |
} | |
}; | |
#endif // Singleton_h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment