net/StaticSocketAddress: add struct sockaddr cast operators

This commit is contained in:
Max Kellermann 2017-08-10 12:40:58 +02:00
parent 54de8b8e77
commit 7f83d38bca

View File

@ -56,6 +56,14 @@ public:
size);
}
operator struct sockaddr *() noexcept {
return reinterpret_cast<struct sockaddr *>(&address);
}
operator const struct sockaddr *() const noexcept {
return reinterpret_cast<const struct sockaddr *>(&address);
}
struct sockaddr *GetAddress() noexcept {
return reinterpret_cast<struct sockaddr *>(&address);
}