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.txx | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'odb/lazy-ptr.txx') diff --git a/odb/lazy-ptr.txx b/odb/lazy-ptr.txx index 81065c3..67319ec 100644 --- a/odb/lazy-ptr.txx +++ b/odb/lazy-ptr.txx @@ -110,34 +110,6 @@ 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 - { - std::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 (); - } - } - #endif // ODB_CXX11 } -- cgit v1.1