add some basic operators to peer_connection_handle

This commit is contained in:
Steven Siloti 2015-08-02 14:03:35 -07:00
parent 0dd4ff4f3c
commit a29e64965c
1 changed files with 7 additions and 0 deletions

View File

@ -108,6 +108,13 @@ struct TORRENT_EXPORT peer_connection_handle
time_t last_seen_complete() const;
time_point time_of_last_unchoke() const;
bool operator==(peer_connection_handle const& o) const
{ return m_connection.lock() == o.m_connection.lock(); }
bool operator!=(peer_connection_handle const& o) const
{ return m_connection.lock() != o.m_connection.lock(); }
bool operator<(peer_connection_handle const& o) const
{ return m_connection.lock() < o.m_connection.lock(); }
boost::shared_ptr<peer_connection> native_handle() const
{
return m_connection.lock();