From: Jacob Lifshay Date: Thu, 29 Jun 2017 07:27:08 +0000 (-0700) Subject: add basic_string_view cast operator to text::Encoded_character X-Git-Tag: gsoc-2017~76 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=368da4face6a90a57d05acd891ebe9236a8c030e;p=kazan.git add basic_string_view cast operator to text::Encoded_character --- 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)