made fc::ip::endpoint sortable
This commit is contained in:
parent
57e5796839
commit
a1c8138b38
1 changed files with 6 additions and 0 deletions
|
|
@ -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:
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue