net/StaticSocketAddress: make the cast operators constexpr
This commit is contained in:
parent
50de3a7886
commit
f7c326dbeb
@ -54,17 +54,16 @@ public:
|
|||||||
|
|
||||||
StaticSocketAddress &operator=(SocketAddress other) noexcept;
|
StaticSocketAddress &operator=(SocketAddress other) noexcept;
|
||||||
|
|
||||||
operator SocketAddress() const noexcept {
|
constexpr operator SocketAddress() const noexcept {
|
||||||
return SocketAddress(reinterpret_cast<const struct sockaddr *>(&address),
|
return SocketAddress(*this, size);
|
||||||
size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
operator struct sockaddr *() noexcept {
|
constexpr operator struct sockaddr *() noexcept {
|
||||||
return reinterpret_cast<struct sockaddr *>(&address);
|
return (struct sockaddr *)(void *)&address;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator const struct sockaddr *() const noexcept {
|
constexpr operator const struct sockaddr *() const noexcept {
|
||||||
return reinterpret_cast<const struct sockaddr *>(&address);
|
return (const struct sockaddr *)(const void *)&address;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr size_type GetCapacity() const noexcept {
|
constexpr size_type GetCapacity() const noexcept {
|
||||||
|
Loading…
Reference in New Issue
Block a user