util/SpanCast: add ToStringView() with non-const std::byte

Without this, we would get std::string_view<std::byte> which makes no
sense.
This commit is contained in:
Max Kellermann 2024-04-03 20:57:46 +02:00
parent ef2cdc0c6a
commit 1e5c37ee78

View File

@ -88,6 +88,12 @@ ToStringView(std::span<const std::byte> s) noexcept
return ToStringView(FromBytesStrict<const char>(s));
}
constexpr std::string_view
ToStringView(std::span<std::byte> s) noexcept
{
return ToStringView(FromBytesStrict<const char>(s));
}
template<typename T>
constexpr std::basic_string_view<T>
ToStringView(std::span<const T> s) noexcept