From e131f226429109c920f85bb863fd5c3fcc425368 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 8 Apr 2024 21:01:54 +0200 Subject: [PATCH] util/SpanCast: merge two ToStringView() using std::remove_const_t --- src/util/SpanCast.hxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/util/SpanCast.hxx b/src/util/SpanCast.hxx index b99e5111e..d786f9d89 100644 --- a/src/util/SpanCast.hxx +++ b/src/util/SpanCast.hxx @@ -9,6 +9,7 @@ #include #include #include +#include /** * Cast a std::span to a std::span, rounding down to the @@ -95,14 +96,7 @@ ToStringView(std::span s) noexcept } template -constexpr std::basic_string_view -ToStringView(std::span s) noexcept -{ - return {s.data(), s.size()}; -} - -template -constexpr std::basic_string_view +constexpr std::basic_string_view> ToStringView(std::span s) noexcept { return {s.data(), s.size()};