Net/StaticSocketAddress: add equality operator with SocketAddress
This commit is contained in:
parent
7de0a621e3
commit
20d69b957f
@ -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:
|
|||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user