Skip to content

Instantly share code, notes, and snippets.

@Naios
Created July 1, 2014 18:53
Show Gist options
  • Save Naios/842f734e0952134c1c96 to your computer and use it in GitHub Desktop.
Save Naios/842f734e0952134c1c96 to your computer and use it in GitHub Desktop.
#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