diff options
Diffstat (limited to 'libcxx/include/string')
-rw-r--r-- | libcxx/include/string | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libcxx/include/string b/libcxx/include/string index 081467e..729a420 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -280,6 +280,8 @@ public: basic_string substr(size_type pos = 0, size_type n = npos) const; // constexpr in C++20, removed in C++23 basic_string substr(size_type pos = 0, size_type n = npos) const&; // since C++23 constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&; // since C++23 + constexpr basic_string_view<charT, traits> subview(size_type pos = 0, + size_type n = npos) const; // since C++26 void swap(basic_string& str) noexcept(allocator_traits<allocator_type>::propagate_on_container_swap::value || allocator_traits<allocator_type>::is_always_equal::value); // C++17, constexpr since C++20 @@ -1055,13 +1057,13 @@ public: } # endif // _LIBCPP_CXX03_LANG - template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0> + template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s) { _LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*) detected nullptr"); __init(__s, traits_type::length(__s)); } - template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0> + template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, const _Allocator& __a) : __alloc_(__a) { @@ -1110,7 +1112,7 @@ public: } # endif - template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0> + template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a) : __alloc_(__a) { __init(__n, __c); @@ -1758,6 +1760,11 @@ public: return basic_string(std::move(*this), __pos, __n); } # endif +# if _LIBCPP_STD_VER >= 26 + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __self_view subview(size_type __pos = 0, size_type __n = npos) const { + return __self_view(*this).subview(__pos, __n); + } +# endif _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(basic_string& __str) # if _LIBCPP_STD_VER >= 14 @@ -2565,21 +2572,21 @@ template <class _InputIterator, class _CharT = __iter_value_type<_InputIterator>, class _Allocator = allocator<_CharT>, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>, - class = enable_if_t<__is_allocator<_Allocator>::value> > + class = enable_if_t<__is_allocator_v<_Allocator>>> basic_string(_InputIterator, _InputIterator, _Allocator = _Allocator()) -> basic_string<_CharT, char_traits<_CharT>, _Allocator>; template <class _CharT, class _Traits, class _Allocator = allocator<_CharT>, - class = enable_if_t<__is_allocator<_Allocator>::value> > + class = enable_if_t<__is_allocator_v<_Allocator>>> explicit basic_string(basic_string_view<_CharT, _Traits>, const _Allocator& = _Allocator()) -> basic_string<_CharT, _Traits, _Allocator>; template <class _CharT, class _Traits, class _Allocator = allocator<_CharT>, - class = enable_if_t<__is_allocator<_Allocator>::value>, + class = enable_if_t<__is_allocator_v<_Allocator>>, class _Sz = typename allocator_traits<_Allocator>::size_type > basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _Allocator()) -> basic_string<_CharT, _Traits, _Allocator>; @@ -2588,7 +2595,7 @@ basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _ # if _LIBCPP_STD_VER >= 23 template <ranges::input_range _Range, class _Allocator = allocator<ranges::range_value_t<_Range>>, - class = enable_if_t<__is_allocator<_Allocator>::value> > + class = enable_if_t<__is_allocator_v<_Allocator>>> basic_string(from_range_t, _Range&&, _Allocator = _Allocator()) -> basic_string<ranges::range_value_t<_Range>, char_traits<ranges::range_value_t<_Range>>, _Allocator>; # endif |