From 1e5c37ee78b562363e50331918949d1b1aabc72e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 3 Apr 2024 20:57:46 +0200 Subject: [PATCH] util/SpanCast: add ToStringView() with non-const std::byte Without this, we would get std::string_view which makes no sense. --- src/util/SpanCast.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/SpanCast.hxx b/src/util/SpanCast.hxx index a97edb6b2..b99e5111e 100644 --- a/src/util/SpanCast.hxx +++ b/src/util/SpanCast.hxx @@ -88,6 +88,12 @@ ToStringView(std::span s) noexcept return ToStringView(FromBytesStrict(s)); } +constexpr std::string_view +ToStringView(std::span s) noexcept +{ + return ToStringView(FromBytesStrict(s)); +} + template constexpr std::basic_string_view ToStringView(std::span s) noexcept