]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement the equivalent of std::unique_ptr using boost::scoped_ptr.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 7 Aug 2009 16:02:58 +0000 (16:02 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 7 Aug 2009 16:02:58 +0000 (16:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@19195 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/std_cxx1x/shared_ptr.h

index d2ba164292b5c1b20aff4154ffed2bfdd780296c..ad5aaf494724af33a2448feb4c85f358855df9f5 100644 (file)
 #else
 
 #include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
 
 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 T> class unique_ptr : public boost::scoped_ptr<T>
+  {
+    public:
+      explicit unique_ptr(T * p = 0)
+                     :
+                     boost::scoped_ptr<T> (p)
+       {}
+  };
+
 }
 DEAL_II_NAMESPACE_CLOSE
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.