From 604ad8e477e1de1e909dd1a615e2fc9693e07b00 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 7 Aug 2009 16:02:58 +0000 Subject: [PATCH] Implement the equivalent of std::unique_ptr using boost::scoped_ptr. git-svn-id: https://svn.dealii.org/trunk@19195 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/std_cxx1x/shared_ptr.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deal.II/base/include/base/std_cxx1x/shared_ptr.h b/deal.II/base/include/base/std_cxx1x/shared_ptr.h index d2ba164292..ad5aaf4947 100644 --- a/deal.II/base/include/base/std_cxx1x/shared_ptr.h +++ b/deal.II/base/include/base/std_cxx1x/shared_ptr.h @@ -23,12 +23,26 @@ #else #include +#include DEAL_II_NAMESPACE_OPEN namespace std_cxx1x { using boost::shared_ptr; using boost::enable_shared_from_this; + + // boost doesn't have boost::unique_ptr, + // but its scoped_ptr comes close so + // re-implement unique_ptr using scoped_ptr + template class unique_ptr : public boost::scoped_ptr + { + public: + explicit unique_ptr(T * p = 0) + : + boost::scoped_ptr (p) + {} + }; + } DEAL_II_NAMESPACE_CLOSE -- 2.39.5