From 368da4face6a90a57d05acd891ebe9236a8c030e Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 29 Jun 2017 00:27:08 -0700 Subject: [PATCH] add basic_string_view cast operator to text::Encoded_character --- src/util/text.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/text.h b/src/util/text.h index e68eb49..70f04c1 100644 --- a/src/util/text.h +++ b/src/util/text.h @@ -201,6 +201,11 @@ public: { return std::basic_string(begin(), end()); } + template + constexpr operator basic_string_view() const noexcept + { + return basic_string_view(chars, used); + } template friend std::basic_string operator+( std::basic_string a, const Encoded_character &b) -- 2.30.2