diff --git a/include/boost/smart_ptr/detail/shared_count.hpp b/include/boost/smart_ptr/detail/shared_count.hpp index 69cc915..85e6b1f 100644 --- a/include/boost/smart_ptr/detail/shared_count.hpp +++ b/include/boost/smart_ptr/detail/shared_count.hpp @@ -494,11 +494,13 @@ public: return a.pi_ == b.pi_; } - 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 std::less()( a.pi_, b.pi_ ); + return std::less()( pi_, r.pi_ ); } + bool operator<( weak_count const & r ) const BOOST_SP_NOEXCEPT; + void * get_deleter( sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT { return pi_? pi_->get_deleter( ti ): 0; @@ -625,9 +627,14 @@ public: return a.pi_ == b.pi_; } - 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 std::less()(a.pi_, b.pi_); + return std::less()( pi_, r.pi_ ); + } + + bool operator<( shared_count const & r ) const BOOST_SP_NOEXCEPT + { + return std::less()( pi_, r.pi_ ); } }; @@ -653,6 +660,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 std::less()( pi_, r.pi_ ); +} + } // namespace detail } // namespace boost