33 #ifndef _GLIBCXX_STRING
34 #define _GLIBCXX_STRING 1
36 #pragma GCC system_header
51 #if __cplusplus > 201703L
58 #if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
59 namespace std _GLIBCXX_VISIBILITY(default)
61 _GLIBCXX_BEGIN_NAMESPACE_VERSION
63 template<
typename _Tp>
class polymorphic_allocator;
64 template<
typename _CharT,
typename _Traits =
char_traits<_CharT>>
66 polymorphic_allocator<_CharT>>;
67 using string = basic_string<char>;
68 #ifdef _GLIBCXX_USE_CHAR8_T
69 using u8string = basic_string<char8_t>;
73 #ifdef _GLIBCXX_USE_WCHAR_T
74 using wstring = basic_string<wchar_t>;
78 template<
typename _Str>
79 struct __hash_string_base
80 :
public __hash_base<size_t, _Str>
83 operator()(
const _Str& __s)
const noexcept
84 {
return hash<basic_string_view<typename _Str::value_type>>{}(__s); }
89 :
public __hash_string_base<pmr::string>
91 #ifdef _GLIBCXX_USE_CHAR8_T
93 struct hash<pmr::u8string>
94 :
public __hash_string_base<pmr::u8string>
99 :
public __hash_string_base<pmr::u16string>
103 :
public __hash_string_base<pmr::u32string>
105 #ifdef _GLIBCXX_USE_WCHAR_T
108 :
public __hash_string_base<pmr::wstring>
112 _GLIBCXX_END_NAMESPACE_VERSION
116 #if __cplusplus > 201703L
117 namespace std _GLIBCXX_VISIBILITY(default)
119 _GLIBCXX_BEGIN_NAMESPACE_VERSION
121 #define __cpp_lib_erase_if 201900L
123 template<
typename _CharT,
typename _Traits,
typename _Alloc,
125 inline typename basic_string<_CharT, _Traits, _Alloc>::size_type
126 erase_if(basic_string<_CharT, _Traits, _Alloc>& __cont, _Predicate __pred)
128 const auto __osz = __cont.size();
129 __cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
131 return __osz - __cont.size();
134 template<
typename _CharT,
typename _Traits,
typename _Alloc,
typename _Up>
135 inline typename basic_string<_CharT, _Traits, _Alloc>::size_type
136 erase(basic_string<_CharT, _Traits, _Alloc>& __cont,
const _Up& __value)
138 const auto __osz = __cont.size();
139 __cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
141 return __osz - __cont.size();
143 _GLIBCXX_END_NAMESPACE_VERSION
basic_string< char32_t > u32string
A string of char32_t.
basic_string< wchar_t > wstring
A string of wchar_t.
enable_if< ::__array_traits< _Tp, _Nm >::_Is_swappable::value >::type noexcept(noexcept(__one.swap(__two)))
swap
_GLIBCXX_END_NAMESPACE_CXX11 typedef basic_string< char > string
A string of char.
basic_string< char16_t > u16string
A string of char16_t.
Managing sequences of characters and character-like objects.