diff options
Diffstat (limited to 'include/unicode.h')
-rw-r--r-- | include/unicode.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/unicode.h b/include/unicode.h index 2969aa0..b90ed15 100644 --- a/include/unicode.h +++ b/include/unicode.h @@ -43,9 +43,9 @@ namespace { return value; } - std::u8string::iterator iterator; + std::u8string::const_iterator iterator; - std::u8string::iterator end_iterator; + std::u8string::const_iterator end_iterator; value_type value{}; }; @@ -71,6 +71,7 @@ namespace { reference operator=(const char32_t& value) { s.push_back(0); // TODO + return *this; } std::u16string& s; @@ -81,14 +82,14 @@ namespace { return utf16_back_insert_iterator(s); } - utf8_iterator utf8_begin(std::u8string& s) + utf8_iterator utf8_begin(const std::u8string& s) { - return utf8_iterator{s.begin(), s.end()}; + return utf8_iterator{s.cbegin(), s.cend()}; } - utf8_iterator utf8_end(std::u8string& s) + utf8_iterator utf8_end(const std::u8string& s) { - return utf8_iterator{s.end(), s.end()}; + return utf8_iterator{s.cend(), s.cend()}; } } // namespace |