aboutsummaryrefslogtreecommitdiff
path: root/odb/lazy-ptr.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-08-14 11:27:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-08-14 11:27:35 +0200
commit8ceee297981402eb5331f357b27ebfac11706ec4 (patch)
treebb4d5d26bb450a3f0f0e499360f90d900b557521 /odb/lazy-ptr.txx
parent9bf4ff12e6d96870fa48785846de5c96411ec5ea (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/lazy-ptr.txx')
-rw-r--r--odb/lazy-ptr.txx28
1 files changed, 0 insertions, 28 deletions
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<object_type1> () == r.template object_id<object_type2> ();
}
-
- //
- // lazy_weak_ptr
- //
-
- template <class T>
- lazy_shared_ptr<T> lazy_weak_ptr<T>::
- lock () const
- {
- std::shared_ptr<T> sp (p_.lock ());
-
- if (sp)
- {
- if (database_type* db = i_.database ())
- return lazy_shared_ptr<T> (*db, sp);
- else
- return lazy_shared_ptr<T> (sp);
- }
- else
- {
- if (i_)
- return lazy_shared_ptr<T> (
- *i_.database (), i_.template object_id<T> ());
- else
- return lazy_shared_ptr<T> ();
- }
- }
-
#endif // ODB_CXX11
}