projects
/
kazan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09fd4df
)
add basic_string_view cast operator to text::Encoded_character
author
Jacob Lifshay
<programmerjake@gmail.com>
Thu, 29 Jun 2017 07:27:08 +0000
(
00:27
-0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Thu, 29 Jun 2017 07:27:08 +0000
(
00:27
-0700)
src/util/text.h
patch
|
blob
|
history
diff --git
a/src/util/text.h
b/src/util/text.h
index e68eb499e580d927859d3bce1bafd59817a4629b..70f04c1906d6c0967154fac1d693325c0beaece7 100644
(file)
--- a/
src/util/text.h
+++ b/
src/util/text.h
@@
-201,6
+201,11
@@
public:
{
return std::basic_string<Char_type, Char_traits, Allocator>(begin(), end());
}
+ template <typename Char_traits>
+ constexpr operator basic_string_view<Char_type, Char_traits>() const noexcept
+ {
+ return basic_string_view<Char_type, Char_traits>(chars, used);
+ }
template <typename Char_traits, typename Allocator>
friend std::basic_string<Char_type, Char_traits, Allocator> operator+(
std::basic_string<Char_type, Char_traits, Allocator> a, const Encoded_character &b)