From 031a5b46f3333f2b0aa0bb92acd2c92f99e6359b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Aug 2015 11:27:36 +0200 Subject: 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. --- odb/boost/smart-ptr/lazy-ptr.hxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'odb/boost/smart-ptr/lazy-ptr.hxx') 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 friend class lazy_shared_ptr; template friend class lazy_weak_ptr; + // For lazy_weak_ptr::lock(). + // + lazy_shared_ptr (const ::boost::shared_ptr& p, + const lazy_ptr_impl& i) + : p_ (p), i_ (i) {} + + private: mutable ::boost::shared_ptr p_; mutable lazy_ptr_impl i_; }; -- cgit v1.1