diff options
author | Max Kellermann <max@musicpd.org> | 2017-08-10 12:40:58 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-08-10 13:12:13 +0200 |
commit | 7f83d38bcaaac7c366395ae3a10e04de5ca744c0 (patch) | |
tree | 786a0db7cfd24af140468c0dad5ab909415d9cf7 /src/net | |
parent | 54de8b8e77c90a42aef8f0ef665caf42c0f1d1b6 (diff) |
net/StaticSocketAddress: add struct sockaddr cast operators
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/StaticSocketAddress.hxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net/StaticSocketAddress.hxx b/src/net/StaticSocketAddress.hxx index 2305379aa..74427c61e 100644 --- a/src/net/StaticSocketAddress.hxx +++ b/src/net/StaticSocketAddress.hxx @@ -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); } |