Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76163 - in branches/release: . boost boost/smart_ptr libs libs/smart_ptr/test
From: pdimov_at_[hidden]
Date: 2011-12-25 19:23:01


Author: pdimov
Date: 2011-12-25 19:23:00 EST (Sun, 25 Dec 2011)
New Revision: 76163
URL: http://svn.boost.org/trac/boost/changeset/76163

Log:
Merge [76111] to release. Fixes #2603.
Added:
   branches/release/boost/smart_ptr/owner_less.hpp
      - copied unchanged from r76111, /trunk/boost/smart_ptr/owner_less.hpp
   branches/release/libs/smart_ptr/test/owner_less_test.cpp
      - copied unchanged from r76111, /trunk/libs/smart_ptr/test/owner_less_test.cpp
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/libs/ (props changed)
Text files modified:
   branches/release/boost/smart_ptr/shared_ptr.hpp | 9 +++++++--
   branches/release/boost/smart_ptr/weak_ptr.hpp | 9 +++++++--
   branches/release/libs/smart_ptr/test/Jamfile.v2 | 1 +
   3 files changed, 15 insertions(+), 4 deletions(-)

Modified: branches/release/boost/smart_ptr/shared_ptr.hpp
==============================================================================
--- branches/release/boost/smart_ptr/shared_ptr.hpp (original)
+++ branches/release/boost/smart_ptr/shared_ptr.hpp 2011-12-25 19:23:00 EST (Sun, 25 Dec 2011)
@@ -449,7 +449,12 @@
         pn.swap(other.pn);
     }
 
- template<class Y> bool _internal_less(shared_ptr<Y> const & rhs) const
+ template<class Y> bool owner_before( shared_ptr<Y> const & rhs ) const
+ {
+ return pn < rhs.pn;
+ }
+
+ template<class Y> bool owner_before( weak_ptr<Y> const & rhs ) const
     {
         return pn < rhs.pn;
     }
@@ -505,7 +510,7 @@
 
 template<class T, class U> inline bool operator<(shared_ptr<T> const & a, shared_ptr<U> const & b)
 {
- return a._internal_less(b);
+ return a.owner_before( b );
 }
 
 template<class T> inline void swap(shared_ptr<T> & a, shared_ptr<T> & b)

Modified: branches/release/boost/smart_ptr/weak_ptr.hpp
==============================================================================
--- branches/release/boost/smart_ptr/weak_ptr.hpp (original)
+++ branches/release/boost/smart_ptr/weak_ptr.hpp 2011-12-25 19:23:00 EST (Sun, 25 Dec 2011)
@@ -205,7 +205,12 @@
         pn = pn2;
     }
 
- template<class Y> bool _internal_less(weak_ptr<Y> const & rhs) const
+ template<class Y> bool owner_before( weak_ptr<Y> const & rhs ) const
+ {
+ return pn < rhs.pn;
+ }
+
+ template<class Y> bool owner_before( shared_ptr<Y> const & rhs ) const
     {
         return pn < rhs.pn;
     }
@@ -229,7 +234,7 @@
 
 template<class T, class U> inline bool operator<(weak_ptr<T> const & a, weak_ptr<U> const & b)
 {
- return a._internal_less(b);
+ return a.owner_before( b );
 }
 
 template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b)

Modified: branches/release/libs/smart_ptr/test/Jamfile.v2
==============================================================================
--- branches/release/libs/smart_ptr/test/Jamfile.v2 (original)
+++ branches/release/libs/smart_ptr/test/Jamfile.v2 2011-12-25 19:23:00 EST (Sun, 25 Dec 2011)
@@ -67,5 +67,6 @@
           [ run sp_hash_test.cpp ]
           [ run get_deleter_array_test.cpp ]
           [ run ip_hash_test.cpp ]
+ [ run owner_less_test.cpp ]
         ;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk