Skip to content

Commit d95d6a4

Browse files
authored
IPRangeSet::erase (#12548)
This adds IPRangeSet::erase to libswoc. This is in the libswoc 1.5.15 release and brings us up to date with that release. I'll do a separate PR with the version update.
1 parent 23fc46f commit d95d6a4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/swoc/include/swoc/IPRange.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,13 @@ class IPRangeSet {
15701570
*/
15711571
self_type &fill(swoc::IPRange const &r);
15721572

1573+
/** Erase addresses from the set.
1574+
*
1575+
* @param r Range of addresses to erase.
1576+
* @return @a this
1577+
*/
1578+
self_type &erase(swoc::IPRange const &r);
1579+
15731580
/// @return @c true if @a addr is in the set.
15741581
bool contains(swoc::IPAddr const &addr) const;
15751582

@@ -1675,6 +1682,12 @@ IPRangeSet::fill(swoc::IPRange const &r) -> self_type & {
16751682
return *this;
16761683
}
16771684

1685+
inline auto
1686+
IPRangeSet::erase(swoc::IPRange const &r) -> self_type & {
1687+
_addrs.erase(r);
1688+
return *this;
1689+
}
1690+
16781691
inline bool
16791692
IPRangeSet::contains(swoc::IPAddr const &addr) const {
16801693
return _addrs.find(addr) != _addrs.end();

0 commit comments

Comments
 (0)