aboutsummaryrefslogtreecommitdiff
path: root/odb/boost/smart-ptr/lazy-ptr.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-08-14 11:27:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-08-14 11:27:36 +0200
commit031a5b46f3333f2b0aa0bb92acd2c92f99e6359b (patch)
tree30365cc3b97471876376b4d7893c0b8b7a4f47f4 /odb/boost/smart-ptr/lazy-ptr.hxx
parentca82b73b8a51dacce0395dc24560733e378fb3bb (diff)
Reimplement lazy_weak_ptr lock() to preserve database type
Now we initialize the returned lazy_shared_ptr with the same loader function as the one set for weak_ptr.
Diffstat (limited to 'odb/boost/smart-ptr/lazy-ptr.hxx')
-rw-r--r--odb/boost/smart-ptr/lazy-ptr.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/odb/boost/smart-ptr/lazy-ptr.hxx b/odb/boost/smart-ptr/lazy-ptr.hxx
index 5050e16..ded4c74 100644
--- a/odb/boost/smart-ptr/lazy-ptr.hxx
+++ b/odb/boost/smart-ptr/lazy-ptr.hxx
@@ -136,6 +136,13 @@ namespace odb
template <class Y> friend class lazy_shared_ptr;
template <class Y> friend class lazy_weak_ptr;
+ // For lazy_weak_ptr::lock().
+ //
+ lazy_shared_ptr (const ::boost::shared_ptr<T>& p,
+ const lazy_ptr_impl<T>& i)
+ : p_ (p), i_ (i) {}
+
+ private:
mutable ::boost::shared_ptr<T> p_;
mutable lazy_ptr_impl<T> i_;
};