Skip to content
Snippets Groups Projects
Commit 1daed61a authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Use unique_ptr instead of shared_ptr.

This fixes FS#1398 for dune-common.
parent 7dbd36f4
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ namespace Dune
class Singleton
{
/** @brief Smartpointer to the instance. */
static std::auto_ptr<T> instance_;
static std::unique_ptr<T> instance_;
protected:
/* @brief Private constructor. */
Singleton(){}
......@@ -70,13 +70,13 @@ namespace Dune
static T& instance()
{
if(instance_.get() == 0)
instance_ = std::auto_ptr<T>(new T());
instance_ = std::unique_ptr<T>(new T());
return *instance_;
}
};
template<class T>
typename std::auto_ptr<T> Singleton<T>::instance_;
typename std::unique_ptr<T> Singleton<T>::instance_;
} // namespace Dune
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment