diff options
Diffstat (limited to 'libstdc++-v3/include/bits/unicode.h')
-rw-r--r-- | libstdc++-v3/include/bits/unicode.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h index 24b1ac3..f1b6bf4 100644 --- a/libstdc++-v3/include/bits/unicode.h +++ b/libstdc++-v3/include/bits/unicode.h @@ -151,6 +151,11 @@ namespace __unicode { return _M_curr(); } [[nodiscard]] + constexpr iter_difference_t<_Iter> + _M_units() const requires forward_iterator<_Iter> + { return _M_to_increment; } + + [[nodiscard]] constexpr value_type operator*() const { return _M_buf[_M_buf_index]; } @@ -610,6 +615,18 @@ inline namespace __v16_0_0 } // @pre c <= 0x10FFFF + constexpr bool + __should_escape_category(char32_t __c) noexcept + { + constexpr uint32_t __mask = 0x01; + auto* __end = std::end(__escape_edges); + auto* __p = std::lower_bound(__escape_edges, __end, + (__c << 1u) + 2); + return __p[-1] & __mask; + } + + + // @pre c <= 0x10FFFF constexpr _Gcb_property __grapheme_cluster_break_property(char32_t __c) noexcept { @@ -1039,6 +1056,8 @@ inline namespace __v16_0_0 string_view __s(__enc); if (__s.ends_with("//")) __s.remove_suffix(2); + if (__s.ends_with("LE") || __s.ends_with("BE")) + __s.remove_suffix(2); return __s == "16" || __s == "32"; } } |