Index: boost/shared_ptr.hpp =================================================================== --- boost/shared_ptr.hpp (revision 50320) +++ boost/shared_ptr.hpp (working copy) @@ -511,11 +511,16 @@ return pn; } - template bool _internal_less(shared_ptr const & rhs) const + template bool owner_before(shared_ptr const & rhs) const { return pn < rhs.pn; } + template bool owner_before(weak_ptr const & rhs) const + { + return pn < rhs.pn; + } + bool _internal_equiv( shared_ptr const & r ) const { return px == r.px && pn == r.pn; @@ -562,7 +567,7 @@ template inline bool operator<(shared_ptr const & a, shared_ptr const & b) { - return a._internal_less(b); + return a.owner_before(b); } template inline void swap(shared_ptr & a, shared_ptr & b) Index: boost/weak_ptr.hpp =================================================================== --- boost/weak_ptr.hpp (revision 50320) +++ boost/weak_ptr.hpp (working copy) @@ -141,11 +141,16 @@ pn = pn2; } - template bool _internal_less(weak_ptr const & rhs) const + template bool owner_before(shared_ptr const & rhs) const { return pn < rhs.pn; } + template bool owner_before(weak_ptr const & rhs) const + { + return pn < rhs.pn; + } + // Tasteless as this may seem, making all members public allows member templates // to work in the absence of member template friends. (Matthew Langston) @@ -165,7 +170,7 @@ template inline bool operator<(weak_ptr const & a, weak_ptr const & b) { - return a._internal_less(b); + return a.owner_before(b); } template void swap(weak_ptr & a, weak_ptr & b) Index: libs/smart_ptr/test/Jamfile.v2 =================================================================== --- libs/smart_ptr/test/Jamfile.v2 (revision 50320) +++ libs/smart_ptr/test/Jamfile.v2 (working copy) @@ -50,5 +50,6 @@ [ run wp_convertible_test.cpp ] [ run ip_convertible_test.cpp ] [ run allocate_shared_test.cpp ] + [ run owner_less_test.cpp ] ; }