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