21 Internet protocol [internet]

21.4 Class ip::address [internet.address]

21.4.4 ip::address comparisons [internet.address.comparisons]

constexpr bool operator==(const address& a, const address& b) noexcept;

Returns:

  • if a.is_v4() != b.is_v4(), false;

  • if a.is_v4(), the result of a.v4_ == b.v4_;

  • otherwise, the result of a.v6_ == b.v6_.

constexpr bool operator!=(const address& a, const address& b) noexcept;

Returns: !(a == b).

constexpr bool operator< (const address& a, const address& b) noexcept;

Returns:

  • if a.is_v4() && !b.is_v4(), true;

  • if !a.is_v4() && b.is_v4(), false;

  • if a.is_v4(), the result of a.v4_ < b.v4_;

  • otherwise, the result of a.v6_ < b.v6_.

constexpr bool operator> (const address& a, const address& b) noexcept;

Returns: b < a.

constexpr bool operator<=(const address& a, const address& b) noexcept;

Returns: !(b < a).

constexpr bool operator>=(const address& a, const address& b) noexcept;

Returns: !(a < b).