aboutsummaryrefslogtreecommitdiff
path: root/odb/lazy-ptr-impl.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-02-28 12:42:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-02-28 12:42:00 +0200
commiteaf07e23f93813fa2c2e6b4d67e69fc6f4c48673 (patch)
tree3b6a54db5d3019121b0bbd553322248ce45db4c2 /odb/lazy-ptr-impl.hxx
parent3012187847b2783c49153db3f5486b84074cb2b0 (diff)
Support for C++11 std::shared_ptr/weak_ptr as object pointers
This includes odb::lazy_shared_ptr and odb::lazy_weak_ptr implementations.
Diffstat (limited to 'odb/lazy-ptr-impl.hxx')
-rw-r--r--odb/lazy-ptr-impl.hxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/odb/lazy-ptr-impl.hxx b/odb/lazy-ptr-impl.hxx
index fd11ff8..257cef8 100644
--- a/odb/lazy-ptr-impl.hxx
+++ b/odb/lazy-ptr-impl.hxx
@@ -7,9 +7,12 @@
#include <odb/pre.hxx>
+#include <utility> // std::move
+
#include <odb/forward.hxx> // odb::database
#include <odb/traits.hxx>
+#include <odb/details/config.hxx> // ODB_CXX11
#include <odb/details/export.hxx>
namespace odb
@@ -38,6 +41,17 @@ namespace odb
lazy_ptr_base&
operator= (const lazy_ptr_impl_ref&);
+ // C++11 support.
+ //
+ public:
+#ifdef ODB_CXX11
+ lazy_ptr_base (lazy_ptr_base&&);
+
+ lazy_ptr_base&
+ operator= (lazy_ptr_base&&);
+#endif
+
+ public:
// Reset both the id and database.
//
void
@@ -119,6 +133,24 @@ namespace odb
lazy_ptr_impl&
operator= (const lazy_ptr_impl_ref&);
+ // C++11 support.
+ //
+ public:
+#ifdef ODB_CXX11
+ lazy_ptr_impl (lazy_ptr_impl&&);
+
+ template <typename Y>
+ lazy_ptr_impl (lazy_ptr_impl<Y>&&);
+
+ lazy_ptr_impl&
+ operator= (lazy_ptr_impl&&);
+
+ template <typename Y>
+ lazy_ptr_impl&
+ operator= (lazy_ptr_impl<Y>&&);
+#endif
+
+ public:
using lazy_ptr_base::reset;
using lazy_ptr_base::reset_id;