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.txx | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'odb/boost/smart-ptr/lazy-ptr.txx') diff --git a/odb/boost/smart-ptr/lazy-ptr.txx b/odb/boost/smart-ptr/lazy-ptr.txx index 9087bbb..8481bb5 100644 --- a/odb/boost/smart-ptr/lazy-ptr.txx +++ b/odb/boost/smart-ptr/lazy-ptr.txx @@ -40,32 +40,5 @@ namespace odb return i_.database () == r.i_.database () && object_id () == r.template object_id (); } - - // - // lazy_weak_ptr - // - - template - lazy_shared_ptr lazy_weak_ptr:: - lock () const - { - ::boost::shared_ptr sp (p_.lock ()); - - if (sp) - { - if (database_type* db = i_.database ()) - return lazy_shared_ptr (*db, sp); - else - return lazy_shared_ptr (sp); - } - else - { - if (i_) - return lazy_shared_ptr ( - *i_.database (), i_.template object_id ()); - else - return lazy_shared_ptr (); - } - } } } -- cgit v1.1