@@ -216,6 +216,30 @@ struct Addr {
216216 constexpr bool operator <(const uint32_t raw_addr) const noexcept
217217 { return ntohl (whole) < ntohl (raw_addr); }
218218
219+ /* *
220+ * Operator to check for less-than-or-equal relationship
221+ *
222+ * @param other
223+ * The IPv4 address object to check for less-than-or-equal relationship
224+ *
225+ * @return true if this object is less-than-or-equal to other, false otherwise
226+ */
227+ constexpr bool operator <=(const Addr other) const noexcept
228+ { return (*this < other or *this == other); }
229+
230+ /* *
231+ * Operator to check for less-than-or-equal relationship
232+ *
233+ * @param raw_addr
234+ * The 32-bit value to check for less-than-or-equal relationship
235+ *
236+ * @return true if this object is less-than-or-equal to raw_addr, false otherwise
237+ *
238+ * @note The 32-bit value must be in network byte order
239+ */
240+ constexpr bool operator <=(const uint32_t raw_addr) const noexcept
241+ { return (*this < raw_addr or *this == raw_addr); }
242+
219243 /* *
220244 * Operator to check for greater-than relationship
221245 *
@@ -225,7 +249,7 @@ struct Addr {
225249 * @return true if this object is greater-than other, false otherwise
226250 */
227251 constexpr bool operator >(const Addr other) const noexcept
228- { return not (*this < other); }
252+ { return not (*this <= other); }
229253
230254 /* *
231255 * Operator to check for greater-than relationship
@@ -238,7 +262,31 @@ struct Addr {
238262 * @note The 32-bit value must be in network byte order
239263 */
240264 constexpr bool operator >(const uint32_t raw_addr) const noexcept
241- { return not (*this < raw_addr); }
265+ { return not (*this <= raw_addr); }
266+
267+ /* *
268+ * Operator to check for greater-than-or-equal relationship
269+ *
270+ * @param other
271+ * The IPv4 address object to check for greater-than-or-equal relationship
272+ *
273+ * @return true if this object is greater-than-or-equal to other, false otherwise
274+ */
275+ constexpr bool operator >=(const Addr other) const noexcept
276+ { return (*this > other or *this == other); }
277+
278+ /* *
279+ * Operator to check for greater-than-or-equal relationship
280+ *
281+ * @param raw_addr
282+ * The 32-bit value to check for greater-than-or-equal relationship
283+ *
284+ * @return true if this object is greater-than-or-equal to raw_addr, false otherwise
285+ *
286+ * @note The 32-bit value must be in network byte order
287+ */
288+ constexpr bool operator >=(const uint32_t raw_addr) const noexcept
289+ { return (*this > raw_addr or *this == raw_addr); }
242290
243291 /* *
244292 * Operator to perform a bitwise-and operation on the given
0 commit comments