Net/StaticSocketAddress: add equality operator with SocketAddress

This commit is contained in:
Max Kellermann 2015-07-22 10:54:17 +02:00
parent 7de0a621e3
commit 20d69b957f
2 changed files with 4 additions and 9 deletions

View File

@ -41,10 +41,3 @@ StaticSocketAddress::operator=(SocketAddress other)
memcpy(&address, other.GetAddress(), size);
return *this;
}
bool
StaticSocketAddress::operator==(const StaticSocketAddress &other) const
{
return size == other.size &&
memcmp(&address, &other.address, size) == 0;
}

View File

@ -92,9 +92,11 @@ public:
}
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);
}
};