Skip to content

Commit

Permalink
net/SocketAdddress: remove unnecessary operator!=()
Browse files Browse the repository at this point in the history
The compiler must generate this implicitly from operator==().
  • Loading branch information
MaxKellermann committed Jul 23, 2024
1 parent ae69dd2 commit db3173b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
6 changes: 0 additions & 6 deletions src/net/AllocatedSocketAddress.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ public:
return (SocketAddress)*this == std::forward<T>(other);
}

template<typename T>
[[gnu::pure]]
bool operator!=(T &&other) const noexcept {
return !(*this == std::forward<T>(other));
}

[[gnu::const]]
static AllocatedSocketAddress Null() noexcept {
return AllocatedSocketAddress(nullptr, 0);
Expand Down
5 changes: 0 additions & 5 deletions src/net/LocalSocketAddress.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,4 @@ public:
bool operator==(SocketAddress other) const noexcept {
return static_cast<const SocketAddress>(*this) == other;
}

[[nodiscard]] [[gnu::pure]]
bool operator!=(SocketAddress other) const noexcept {
return !(*this == other);
}
};
4 changes: 0 additions & 4 deletions src/net/SocketAddress.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,4 @@ public:

[[gnu::pure]]
bool operator==(const SocketAddress other) const noexcept;

bool operator!=(const SocketAddress other) const noexcept {
return !(*this == other);
}
};
4 changes: 0 additions & 4 deletions src/net/StaticSocketAddress.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,4 @@ public:
bool operator==(SocketAddress other) const noexcept {
return (SocketAddress)*this == other;
}

bool operator!=(SocketAddress other) const noexcept {
return !(*this == other);
}
};

0 comments on commit db3173b

Please sign in to comment.