aboutsummaryrefslogtreecommitdiff
path: root/odb/lazy-ptr.ixx
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.ixx
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.ixx')
-rw-r--r--odb/lazy-ptr.ixx7
1 files changed, 7 insertions, 0 deletions
diff --git a/odb/lazy-ptr.ixx b/odb/lazy-ptr.ixx
index ccfcd47..9ffa945 100644
--- a/odb/lazy-ptr.ixx
+++ b/odb/lazy-ptr.ixx
@@ -1540,6 +1540,13 @@ namespace odb
}
template <class T>
+ inline lazy_shared_ptr<T> lazy_weak_ptr<T>::
+ lock () const
+ {
+ return lazy_shared_ptr<T> (p_.lock (), i_);
+ }
+
+ template <class T>
inline std::shared_ptr<T> lazy_weak_ptr<T>::
load () const
{