From b2b8dba6c149407d6657398a874c75629871d21a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Apr 2011 11:15:37 +0200 Subject: Fix loaded() function in lazy_ptr to conform to documentation --- odb/lazy-ptr.ixx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'odb/lazy-ptr.ixx') 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:: loaded () const { - return p_ || !i_; + bool i (i_); + return (p_ == 0) != i; // !p_ XOR i } template @@ -361,7 +362,8 @@ namespace odb inline bool lazy_auto_ptr:: loaded () const { - return p_.get () != 0 || !i_; + bool i (i_); + return (p_.get () == 0) != i; // XOR } template -- cgit v1.1