From: Wolfgang Bangerth Date: Fri, 7 Aug 2009 16:02:58 +0000 (+0000) Subject: Implement the equivalent of std::unique_ptr using boost::scoped_ptr. X-Git-Tag: v8.0.0~7373 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c831cc87a2effc6791e946858afaf5156d0edfc;p=dealii.git 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 --- 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