net/SocketAddress: add #ifdefs for std::span

This commit is contained in:
Max Kellermann
2022-05-31 13:50:07 +02:00
parent 6ebac6a0b2
commit 059955a48c
3 changed files with 18 additions and 14 deletions

View File

@@ -131,6 +131,8 @@ SocketAddress::GetPort() const noexcept
}
}
#ifdef __cpp_lib_span
static std::span<const std::byte>
GetSteadyPart(const struct sockaddr_in &address) noexcept
{
@@ -149,7 +151,11 @@ GetSteadyPart(const struct sockaddr_in6 &address) noexcept
};
}
#endif
#endif // __cpp_lib_span
#endif // HAVE_TCP
#ifdef __cpp_lib_span
std::span<const std::byte>
SocketAddress::GetSteadyPart() const noexcept
@@ -175,3 +181,5 @@ SocketAddress::GetSteadyPart() const noexcept
return {};
}
}
#endif