made fc::ip::endpoint sortable

This commit is contained in:
Daniel Larimer 2013-07-15 15:59:12 -04:00
parent 57e5796839
commit a1c8138b38

View file

@ -34,6 +34,12 @@ namespace fc {
const address& get_address()const;
friend bool operator==( const endpoint& a, const endpoint& b );
friend bool operator< ( const endpoint& a, const endpoint& b )
{
return uint32_t(a.get_address()) < uint32_t(b.get_address()) ||
(uint32_t(a.get_address()) == uint32_t(b.get_address()) &&
uint32_t(a.port()) < uint32_t(b.port()));
}
private:
/**