net/AllocatedSocketAddress: convert operator== to template

This commit is contained in:
Max Kellermann 2018-08-21 12:26:19 +02:00
parent 5d7dd12f7a
commit 9151b84c25

View File

@ -84,13 +84,16 @@ public:
return *this;
}
template<typename T>
gcc_pure
bool operator==(SocketAddress other) const noexcept {
return (SocketAddress)*this == other;
bool operator==(T &&other) const noexcept {
return (SocketAddress)*this == std::forward<T>(other);
}
bool operator!=(SocketAddress other) const noexcept {
return !(*this == other);
template<typename T>
gcc_pure
bool operator!=(T &&other) const noexcept {
return !(*this == std::forward<T>(other));
}
gcc_const