aboutsummaryrefslogtreecommitdiff
path: root/odb/details/unique-ptr.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/details/unique-ptr.hxx')
-rw-r--r--odb/details/unique-ptr.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/odb/details/unique-ptr.hxx b/odb/details/unique-ptr.hxx
index 35f4d68..547dd3b 100644
--- a/odb/details/unique-ptr.hxx
+++ b/odb/details/unique-ptr.hxx
@@ -7,6 +7,8 @@
#include <odb/pre.hxx>
+#include <odb/details/config.hxx>
+
namespace odb
{
namespace details
@@ -20,6 +22,20 @@ namespace odb
explicit unique_ptr (T* p = 0): p_ (p) {}
~unique_ptr () {delete p_;}
+#ifdef ODB_CXX11
+ unique_ptr (unique_ptr&& p): p_ (p.p_) {p.p_ = 0;}
+ unique_ptr& operator= (unique_ptr&& p)
+ {
+ if (this != &p)
+ {
+ delete p_;
+ p_ = p.p_;
+ p.p_ = 0;
+ }
+ return *this;
+ }
+#endif
+
private:
unique_ptr (const unique_ptr&);
unique_ptr& operator= (const unique_ptr&);