diff --git a/include/boost/smart_ptr/detail/shared_count.hpp b/include/boost/smart_ptr/detail/shared_count.hpp index 85e6b1f..a3ae638 100644 --- a/include/boost/smart_ptr/detail/shared_count.hpp +++ b/include/boost/smart_ptr/detail/shared_count.hpp @@ -489,11 +489,13 @@ public: return pi_ == 0; } - friend inline bool operator==(shared_count const & a, shared_count const & b) BOOST_SP_NOEXCEPT + bool operator==( shared_count const & r ) const BOOST_SP_NOEXCEPT { - return a.pi_ == b.pi_; + return pi_ == r.pi_; } + bool operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT; + bool operator<( shared_count const & r ) const BOOST_SP_NOEXCEPT { return std::less()( pi_, r.pi_ ); @@ -622,9 +624,14 @@ public: return pi_ == 0; } - friend inline bool operator==(weak_count const & a, weak_count const & b) BOOST_SP_NOEXCEPT + bool operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT { - return a.pi_ == b.pi_; + return pi_ == r.pi_; + } + + bool operator==( shared_count const & r ) const BOOST_SP_NOEXCEPT + { + return pi_ == r.pi_; } bool operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT @@ -660,6 +667,11 @@ inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_ } } +inline bool shared_count::operator==( weak_count const & r ) const BOOST_SP_NOEXCEPT +{ + return pi_ == r.pi_; +} + inline bool shared_count::operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT { return std::less()( pi_, r.pi_ );