aboutsummaryrefslogtreecommitdiff
path: root/odb/lazy-ptr.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/lazy-ptr.ixx')
-rw-r--r--odb/lazy-ptr.ixx6
1 files changed, 4 insertions, 2 deletions
diff --git a/odb/lazy-ptr.ixx b/odb/lazy-ptr.ixx
index 8035923..d682ba5 100644
--- a/odb/lazy-ptr.ixx
+++ b/odb/lazy-ptr.ixx
@@ -108,7 +108,8 @@ namespace odb
inline bool lazy_ptr<T>::
loaded () const
{
- return p_ || !i_;
+ bool i (i_);
+ return (p_ == 0) != i; // !p_ XOR i
}
template <class T>
@@ -361,7 +362,8 @@ namespace odb
inline bool lazy_auto_ptr<T>::
loaded () const
{
- return p_.get () != 0 || !i_;
+ bool i (i_);
+ return (p_.get () == 0) != i; // XOR
}
template <class T>