From a1c8138b387c16f831238e00d46dba0f54b23b2d Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Mon, 15 Jul 2013 15:59:12 -0400 Subject: [PATCH] made fc::ip::endpoint sortable --- include/fc/network/ip.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/fc/network/ip.hpp b/include/fc/network/ip.hpp index 20c9509..555d468 100644 --- a/include/fc/network/ip.hpp +++ b/include/fc/network/ip.hpp @@ -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: /**