diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-18 11:15:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-18 11:15:37 +0200 |
commit | b2b8dba6c149407d6657398a874c75629871d21a (patch) | |
tree | 587f30ada0847768fef5835589b9568f01285638 /odb/lazy-ptr.ixx | |
parent | abd2a4b899f16e2565c7db534ec558fec27173ff (diff) |
Fix loaded() function in lazy_ptr to conform to documentation
Diffstat (limited to 'odb/lazy-ptr.ixx')
-rw-r--r-- | odb/lazy-ptr.ixx | 6 |
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> |