-/**
- * Return true if two addresses are equal.
- */
-inline bool operator==(const IPAddressV6& addr1, const IPAddressV6& addr2) {
- return (std::memcmp(addr1.toAddr().s6_addr, addr2.toAddr().s6_addr, 16) == 0)
- && addr1.getScopeId() == addr2.getScopeId();
-}
-// Return true if addr1 < addr2
-inline bool operator<(const IPAddressV6& addr1, const IPAddressV6& addr2) {
- auto cmp = std::memcmp(addr1.toAddr().s6_addr,
- addr2.toAddr().s6_addr, 16) < 0;
- if (!cmp) {
- return addr1.getScopeId() < addr2.getScopeId();
- } else {
- return cmp;
- }
-}
-// Derived operators
-inline bool operator!=(const IPAddressV6& a, const IPAddressV6& b) {
- return !(a == b);
-}
-inline bool operator>(const IPAddressV6& a, const IPAddressV6& b) {
- return b < a;
-}
-inline bool operator<=(const IPAddressV6& a, const IPAddressV6& b) {
- return !(a > b);
-}
-inline bool operator>=(const IPAddressV6& a, const IPAddressV6& b) {
- return !(a < b);
-}
-