include/xot/pimpl.h in xot-0.1.12 vs include/xot/pimpl.h in xot-0.1.13

- old
+ new

@@ -2,28 +2,24 @@ #pragma once #ifndef __XOT_PIMPL_H__ #define __XOT_PIMPL_H__ -#include <boost/scoped_ptr.hpp> -#include <boost/shared_ptr.hpp> +#include <memory> namespace Xot { - template <typename T, bool SHARED = false> class PImpl; - - template <typename T> - class PImpl<T, false> : public boost::scoped_ptr<T> + class PImpl : public std::unique_ptr<T> { - typedef boost::scoped_ptr<T> Super; + typedef std::unique_ptr<T> Super; - typedef PImpl<T, false> This; + typedef PImpl<T> This; public: PImpl () : Super(new T) {} @@ -35,31 +31,27 @@ { if (&obj != this) reset(new T(*obj)); return *this; } - bool shared () const {return false;} - };// PImpl template <typename T> - class PImpl<T, true> : public boost::shared_ptr<T> + class PSharedImpl : public std::shared_ptr<T> { - typedef boost::shared_ptr<T> Super; + typedef std::shared_ptr<T> Super; - typedef PImpl<T, true> This; + typedef PImpl<T> This; public: - PImpl () : Super(new T) {} + PSharedImpl () : Super(new T) {} - PImpl (T* p) : Super(p) {} + PSharedImpl (T* p) : Super(p) {} - bool shared () const {return true;} - - };// PImpl + };// PSharedImpl }// Xot