From f3a30cffb393caa9ba7f51a86cbd5a1351d022f8 Mon Sep 17 00:00:00 2001 From: Mordor Date: Mon, 30 Mar 2026 17:29:32 +0200 Subject: [PATCH] Add constexpr attribute to operator std::basic_string_view Although the RFC doesn't mention it, there is no reason for this operator to not be constexpr, at least from c++20 and later --- include/beman/cstring_view/cstring_view.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/beman/cstring_view/cstring_view.hpp b/include/beman/cstring_view/cstring_view.hpp index a698e6b..dda8a66 100644 --- a/include/beman/cstring_view/cstring_view.hpp +++ b/include/beman/cstring_view/cstring_view.hpp @@ -168,7 +168,7 @@ class basic_cstring_view { constexpr const_pointer data() const noexcept { return data_; } constexpr const_pointer c_str() const noexcept { return data_; } - operator std::basic_string_view() const noexcept { + constexpr operator std::basic_string_view() const noexcept { return std::basic_string_view{data_, size_}; }