From 8ceee297981402eb5331f357b27ebfac11706ec4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Aug 2015 11:27:35 +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/lazy-ptr.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'odb/lazy-ptr.hxx') diff --git a/odb/lazy-ptr.hxx b/odb/lazy-ptr.hxx index 5e099aa..ccc6c3c 100644 --- a/odb/lazy-ptr.hxx +++ b/odb/lazy-ptr.hxx @@ -519,6 +519,12 @@ namespace odb template friend class lazy_shared_ptr; template friend class lazy_weak_ptr; + // For lazy_weak_ptr::lock(). + // + lazy_shared_ptr (std::shared_ptr&& p, const lazy_ptr_impl& i) + : p_ (std::move (p)), i_ (i) {} + + private: mutable std::shared_ptr p_; mutable lazy_ptr_impl i_; }; -- cgit v1.1