aboutsummaryrefslogtreecommitdiff
path: root/odb/boost/smart-ptr/lazy-ptr.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-18 11:16:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-18 11:16:30 +0200
commit53a30dbef3bb9d60946e96adc88c4a6c1073f566 (patch)
treeb71c0aac9add219e61267f231970c682b705ef78 /odb/boost/smart-ptr/lazy-ptr.ixx
parent5906467062142e497487790f31287e5f243dc57e (diff)
Fix loaded() function in lazy_ptr to conform to documentation
Diffstat (limited to 'odb/boost/smart-ptr/lazy-ptr.ixx')
-rw-r--r--odb/boost/smart-ptr/lazy-ptr.ixx6
1 files changed, 4 insertions, 2 deletions
diff --git a/odb/boost/smart-ptr/lazy-ptr.ixx b/odb/boost/smart-ptr/lazy-ptr.ixx
index 2522ab4..fced28d 100644
--- a/odb/boost/smart-ptr/lazy-ptr.ixx
+++ b/odb/boost/smart-ptr/lazy-ptr.ixx
@@ -192,7 +192,8 @@ namespace odb
inline bool lazy_shared_ptr<T>::
loaded () const
{
- return p_ || !i_;
+ bool i (i_);
+ return !p_ != i; // !p_ XOR i_
}
template <class T>
@@ -524,7 +525,8 @@ namespace odb
inline bool lazy_weak_ptr<T>::
loaded () const
{
- return !expired () || !i_;
+ bool i (i_);
+ return expired () != i; // expired () XOR i_
}
template <class T>