diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h index f1b2b359bdf..d35c83d0090 100644 --- a/libstdc++-v3/include/bits/unicode.h +++ b/libstdc++-v3/include/bits/unicode.h @@ -714,15 +714,15 @@ inline namespace __v15_1_0 }; // Split a range into extended grapheme clusters. - template + template requires ranges::view<_View> class _Grapheme_cluster_view : public ranges::view_interface<_Grapheme_cluster_view<_View>> { public: constexpr - _Grapheme_cluster_view(const _View& __v) - : _M_begin(_Utf32_view(__v).begin()) + _Grapheme_cluster_view(_View __v) + : _M_begin(_Utf32_view<_View>(std::move(__v)).begin()) { } constexpr auto begin() const { return _M_begin; } @@ -946,7 +946,7 @@ inline namespace __v15_1_0 { if (__s.empty()) [[unlikely]] return 0; - _Grapheme_cluster_view __gc(__s); + _Grapheme_cluster_view> __gc(__s); auto __it = __gc.begin(); const auto __end = __gc.end(); size_t __n = __it.width(); @@ -964,7 +964,7 @@ inline namespace __v15_1_0 if (__s.empty()) [[unlikely]] return 0; - _Grapheme_cluster_view __gc(__s); + _Grapheme_cluster_view> __gc(__s); auto __it = __gc.begin(); const auto __end = __gc.end(); size_t __n = __it.width(); @@ -1058,6 +1058,19 @@ inline namespace __v15_1_0 } // namespace __unicode +namespace ranges +{ + template + inline constexpr bool + enable_borrowed_range> + = enable_borrowed_range<_Range>; + + template + inline constexpr bool + enable_borrowed_range> + = enable_borrowed_range<_Range>; +} // namespace ranges + _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // C++20