net/SocketAddress: remove __cpp_lib_span checks
This commit is contained in:
parent
20a5276560
commit
452400b7ef
|
@ -129,8 +129,6 @@ SocketAddress::GetPort() const noexcept
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef __cpp_lib_span
|
||||
|
||||
static std::span<const std::byte>
|
||||
GetSteadyPart(const struct sockaddr_in &address) noexcept
|
||||
{
|
||||
|
@ -149,12 +147,8 @@ GetSteadyPart(const struct sockaddr_in6 &address) noexcept
|
|||
};
|
||||
}
|
||||
|
||||
#endif // __cpp_lib_span
|
||||
|
||||
#endif // HAVE_TCP
|
||||
|
||||
#ifdef __cpp_lib_span
|
||||
|
||||
std::span<const std::byte>
|
||||
SocketAddress::GetSteadyPart() const noexcept
|
||||
{
|
||||
|
@ -179,5 +173,3 @@ SocketAddress::GetSteadyPart() const noexcept
|
|||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,15 +39,12 @@
|
|||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
#include <span>
|
||||
|
||||
#if __cplusplus >= 202002 || (defined(__GNUC__) && __GNUC__ >= 10)
|
||||
#include <version>
|
||||
#endif
|
||||
|
||||
#ifdef __cpp_lib_span
|
||||
#include <span>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UN
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
@ -79,11 +76,9 @@ public:
|
|||
size_type _size) noexcept
|
||||
:address(_address), size(_size) {}
|
||||
|
||||
#ifdef __cpp_lib_span
|
||||
explicit SocketAddress(std::span<const std::byte> src) noexcept
|
||||
:address((const struct sockaddr *)(const void *)src.data()),
|
||||
size(src.size()) {}
|
||||
#endif
|
||||
|
||||
static constexpr SocketAddress Null() noexcept {
|
||||
return nullptr;
|
||||
|
@ -179,7 +174,6 @@ public:
|
|||
unsigned GetPort() const noexcept;
|
||||
#endif
|
||||
|
||||
#ifdef __cpp_lib_span
|
||||
operator std::span<const std::byte>() const noexcept {
|
||||
const void *q = reinterpret_cast<const void *>(address);
|
||||
return {
|
||||
|
@ -197,7 +191,6 @@ public:
|
|||
*/
|
||||
[[gnu::pure]]
|
||||
std::span<const std::byte> GetSteadyPart() const noexcept;
|
||||
#endif
|
||||
|
||||
[[gnu::pure]]
|
||||
bool operator==(const SocketAddress other) const noexcept;
|
||||
|
|
Loading…
Reference in New Issue