3 #ifndef DUNE_SINGLETON_HH
4 #define DUNE_SINGLETON_HH
56 static std::auto_ptr<T> instance_;
72 if(instance_.get() == 0)
73 instance_ = std::auto_ptr<T>(
new T());
79 typename std::auto_ptr<T> Singleton<T>::instance_;
An adapter to turn a class into a singleton.
Definition: singleton.hh:53
Dune namespace.
Definition: alignment.hh:13
Singleton & operator=(const Singleton &)
Private assignment operator.
Definition: singleton.hh:63
Singleton()
Definition: singleton.hh:59
Singleton(const Singleton &)
Private copy constructor.
Definition: singleton.hh:61
static T & instance()
Get the instance of the singleton.
Definition: singleton.hh:70