From eaf07e23f93813fa2c2e6b4d67e69fc6f4c48673 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Feb 2012 12:42:00 +0200 Subject: Support for C++11 std::shared_ptr/weak_ptr as object pointers This includes odb::lazy_shared_ptr and odb::lazy_weak_ptr implementations. --- odb/lazy-ptr-impl.hxx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'odb/lazy-ptr-impl.hxx') 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 +#include // std::move + #include // odb::database #include +#include // ODB_CXX11 #include 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 + lazy_ptr_impl (lazy_ptr_impl&&); + + lazy_ptr_impl& + operator= (lazy_ptr_impl&&); + + template + lazy_ptr_impl& + operator= (lazy_ptr_impl&&); +#endif + + public: using lazy_ptr_base::reset; using lazy_ptr_base::reset_id; -- cgit v1.1