|
|
|
|
@@ -1037,13 +1037,14 @@ public:
|
|
|
|
|
# endif // _LIBCPP_CXX03_LANG
|
|
|
|
|
|
|
|
|
|
template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s) {
|
|
|
|
|
_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>
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a)
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
|
|
|
|
|
basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, const _Allocator& __a)
|
|
|
|
|
: __alloc_(__a) {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
|
|
|
|
|
__init(__s, traits_type::length(__s));
|
|
|
|
|
@@ -1214,7 +1215,8 @@ public:
|
|
|
|
|
return assign(__il.begin(), __il.size());
|
|
|
|
|
}
|
|
|
|
|
# endif
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(const value_type* __s) {
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
|
|
|
|
|
operator=(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) {
|
|
|
|
|
return assign(__s);
|
|
|
|
|
}
|
|
|
|
|
# if _LIBCPP_STD_VER >= 23
|
|
|
|
|
@@ -1340,7 +1342,8 @@ public:
|
|
|
|
|
return append(__sv);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator+=(const value_type* __s) {
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
|
|
|
|
|
operator+=(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) {
|
|
|
|
|
return append(__s);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1381,7 +1384,7 @@ public:
|
|
|
|
|
append(const _Tp& __t, size_type __pos, size_type __n = npos);
|
|
|
|
|
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s, size_type __n);
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* __s);
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append(size_type __n, value_type __c);
|
|
|
|
|
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __append_default_init(size_type __n);
|
|
|
|
|
@@ -1539,7 +1542,7 @@ public:
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
|
|
|
|
|
insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n = npos);
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* __s);
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s);
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert(size_type __pos, size_type __n, value_type __c);
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __pos, value_type __c);
|
|
|
|
|
|
|
|
|
|
@@ -1719,7 +1722,7 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
|
|
|
|
|
find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT {
|
|
|
|
|
find(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find(): received nullptr");
|
|
|
|
|
return std::__str_find<value_type, size_type, traits_type, npos>(
|
|
|
|
|
data(), size(), __s, __pos, traits_type::length(__s));
|
|
|
|
|
@@ -1750,7 +1753,7 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
|
|
|
|
|
rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT {
|
|
|
|
|
rfind(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::rfind(): received nullptr");
|
|
|
|
|
return std::__str_rfind<value_type, size_type, traits_type, npos>(
|
|
|
|
|
data(), size(), __s, __pos, traits_type::length(__s));
|
|
|
|
|
@@ -1783,7 +1786,7 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
|
|
|
|
|
find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT {
|
|
|
|
|
find_first_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_of(): received nullptr");
|
|
|
|
|
return std::__str_find_first_of<value_type, size_type, traits_type, npos>(
|
|
|
|
|
data(), size(), __s, __pos, traits_type::length(__s));
|
|
|
|
|
@@ -1817,7 +1820,7 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
|
|
|
|
|
find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT {
|
|
|
|
|
find_last_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_of(): received nullptr");
|
|
|
|
|
return std::__str_find_last_of<value_type, size_type, traits_type, npos>(
|
|
|
|
|
data(), size(), __s, __pos, traits_type::length(__s));
|
|
|
|
|
@@ -1851,7 +1854,7 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
|
|
|
|
|
find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT {
|
|
|
|
|
find_first_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = 0) const _NOEXCEPT {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_first_not_of(): received nullptr");
|
|
|
|
|
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>(
|
|
|
|
|
data(), size(), __s, __pos, traits_type::length(__s));
|
|
|
|
|
@@ -1885,7 +1888,7 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
|
|
|
|
|
find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT {
|
|
|
|
|
find_last_not_of(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s, size_type __pos = npos) const _NOEXCEPT {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::find_last_not_of(): received nullptr");
|
|
|
|
|
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>(
|
|
|
|
|
data(), size(), __s, __pos, traits_type::length(__s));
|
|
|
|
|
@@ -1933,12 +1936,13 @@ public:
|
|
|
|
|
return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const value_type* __s) const _NOEXCEPT {
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const _NOEXCEPT {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::compare(): received nullptr");
|
|
|
|
|
return compare(0, npos, __s, traits_type::length(__s));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 int compare(size_type __pos1, size_type __n1, const value_type* __s) const {
|
|
|
|
|
_LIBCPP_CONSTEXPR_SINCE_CXX20 int
|
|
|
|
|
compare(size_type __pos1, size_type __n1, const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {
|
|
|
|
|
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "string::compare(): received nullptr");
|
|
|
|
|
return compare(__pos1, __n1, __s, traits_type::length(__s));
|
|
|
|
|
}
|
|
|
|
|
@@ -1957,7 +1961,7 @@ public:
|
|
|
|
|
return !empty() && _Traits::eq(front(), __c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(const value_type* __s) const noexcept {
|
|
|
|
|
constexpr _LIBCPP_HIDE_FROM_ABI bool starts_with(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {
|
|
|
|
|
return starts_with(__self_view(__s));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1971,7 +1975,7 @@ public:
|
|
|
|
|
return !empty() && _Traits::eq(back(), __c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(const value_type* __s) const noexcept {
|
|
|
|
|
constexpr _LIBCPP_HIDE_FROM_ABI bool ends_with(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const noexcept {
|
|
|
|
|
return ends_with(__self_view(__s));
|
|
|
|
|
}
|
|
|
|
|
# endif
|
|
|
|
|
@@ -1987,7 +1991,7 @@ public:
|
|
|
|
|
return __self_view(typename __self_view::__assume_valid(), data(), size()).contains(__c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr _LIBCPP_HIDE_FROM_ABI bool contains(const value_type* __s) const {
|
|
|
|
|
constexpr _LIBCPP_HIDE_FROM_ABI bool contains(const value_type* _LIBCPP_DIAGNOSE_NULLPTR __s) const {
|
|
|
|
|
return __self_view(typename __self_view::__assume_valid(), data(), size()).contains(__s);
|
|
|
|
|
}
|
|
|
|
|
# endif
|
|
|
|
|
|