Commit 20d69b95 authored by Max Kellermann's avatar Max Kellermann

Net/StaticSocketAddress: add equality operator with SocketAddress

parent 7de0a621
...@@ -41,10 +41,3 @@ StaticSocketAddress::operator=(SocketAddress other) ...@@ -41,10 +41,3 @@ StaticSocketAddress::operator=(SocketAddress other)
memcpy(&address, other.GetAddress(), size); memcpy(&address, other.GetAddress(), size);
return *this; return *this;
} }
bool
StaticSocketAddress::operator==(const StaticSocketAddress &other) const
{
return size == other.size &&
memcmp(&address, &other.address, size) == 0;
}
...@@ -92,9 +92,11 @@ public: ...@@ -92,9 +92,11 @@ public:
} }
gcc_pure gcc_pure
bool operator==(const StaticSocketAddress &other) const; bool operator==(SocketAddress other) const {
return (SocketAddress)*this == other;
}
bool operator!=(const StaticSocketAddress &other) const { bool operator!=(SocketAddress &other) const {
return !(*this == other); return !(*this == other);
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment