29 #ifndef _GLIBCXX_DEBUG_STRING 30 #define _GLIBCXX_DEBUG_STRING 1 32 #ifdef _GLIBCXX_SYSHDR 33 #pragma GCC system_header 41 #define _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(_Cond,_File,_Line,_Func) \ 43 __gnu_debug::_Error_formatter::_S_at(_File, _Line, _Func) \ 44 ._M_message(#_Cond)._M_error() 46 #if _GLIBCXX_USE_CXX11_ABI && __cplusplus >= 201103 47 # define _GLIBCXX_INSERT_RETURNS_ITERATOR 1 48 # define _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(expr) expr 50 # define _GLIBCXX_INSERT_RETURNS_ITERATOR 0 51 # define _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(expr) 54 #ifdef _GLIBCXX_DEBUG_PEDANTIC 55 # if __cplusplus < 201103L 56 # define __glibcxx_check_string(_String) \ 57 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(_String != 0, \ 60 # define __glibcxx_check_string_len(_String,_Len) \ 61 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(_String != 0 || _Len == 0, \ 65 # define __glibcxx_check_string(_String) \ 66 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(_String != nullptr, \ 69 # define __glibcxx_check_string_len(_String,_Len) \ 70 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(_String != nullptr || _Len == 0, \ 75 # define __glibcxx_check_string(_String) 76 # define __glibcxx_check_string_len(_String,_Len) 82 template<
typename _CharT,
typename _Integer>
85 _Integer __n __attribute__((__unused__)),
86 const char* __file __attribute__((__unused__)),
87 unsigned int __line __attribute__((__unused__)),
88 const char* __function __attribute__((__unused__)))
90 #ifdef _GLIBCXX_DEBUG_PEDANTIC 91 # if __cplusplus < 201103L 92 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(__s != 0 || __n == 0,
93 __file, __line, __function);
95 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(__s !=
nullptr || __n == 0,
96 __file, __line, __function);
103 template<
typename _CharT>
106 const char* __file __attribute__((__unused__)),
107 unsigned int __line __attribute__((__unused__)),
108 const char* __function __attribute__((__unused__)))
110 #ifdef _GLIBCXX_DEBUG_PEDANTIC 111 # if __cplusplus < 201103L 112 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(__s != 0,
113 __file, __line, __function);
115 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(__s !=
nullptr,
116 __file, __line, __function);
122 #define __glibcxx_check_string_n_constructor(_Str, _Size) \ 123 __check_string(_Str, _Size, __FILE__, __LINE__, __PRETTY_FUNCTION__) 125 #define __glibcxx_check_string_constructor(_Str) \ 126 __check_string(_Str, __FILE__, __LINE__, __PRETTY_FUNCTION__) 129 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT>,
130 typename _Allocator = std::allocator<_CharT> >
133 basic_string<_CharT, _Traits, _Allocator>,
134 _Allocator, _Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>,
142 template<
typename _ItT,
typename _SeqT,
typename _CatT>
143 friend class ::__gnu_debug::_Safe_iterator;
151 typedef _Traits traits_type;
152 typedef typename _Traits::char_type value_type;
153 typedef _Allocator allocator_type;
154 typedef typename _Base::size_type size_type;
155 typedef typename _Base::difference_type difference_type;
156 typedef typename _Base::reference reference;
157 typedef typename _Base::const_reference const_reference;
158 typedef typename _Base::pointer pointer;
159 typedef typename _Base::const_pointer const_pointer;
162 typename _Base::iterator, basic_string>
iterator;
174 basic_string(
const _Allocator& __a) _GLIBCXX_NOEXCEPT
177 #if __cplusplus < 201103L 178 basic_string() : _Base() { }
180 basic_string(
const basic_string& __str)
185 basic_string() =
default;
186 basic_string(
const basic_string&) =
default;
187 basic_string(basic_string&&) =
default;
190 const _Allocator& __a = _Allocator())
194 basic_string(
const basic_string& __s,
const _Allocator& __a)
195 : _Base(__s, __a) { }
197 basic_string(basic_string&& __s,
const _Allocator& __a)
204 ~basic_string() =
default;
207 basic_string(_Base&&
__base) noexcept
212 basic_string(
const _Base&
__base)
217 basic_string(
const basic_string& __str, size_type __pos,
219 const _Allocator& __a = _Allocator())
220 : _Base(__str, __pos, __n, __a) { }
222 basic_string(
const _CharT* __s, size_type __n,
223 const _Allocator& __a = _Allocator())
224 : _Base(__glibcxx_check_string_n_constructor(__s, __n), __n, __a) { }
226 basic_string(
const _CharT* __s,
const _Allocator& __a = _Allocator())
227 : _Base(__glibcxx_check_string_constructor(__s), __a)
230 basic_string(size_type __n, _CharT __c,
231 const _Allocator& __a = _Allocator())
232 : _Base(__n, __c, __a) { }
234 #if __cplusplus >= 201103L 235 template<
typename _InputIterator,
236 typename = std::_RequireInputIter<_InputIterator>>
238 template<
typename _InputIterator>
240 basic_string(_InputIterator __begin, _InputIterator __end,
241 const _Allocator& __a = _Allocator())
243 __glibcxx_check_valid_constructor_range(__begin, __end)),
246 #if __cplusplus >= 201103L 248 operator=(
const basic_string&) =
default;
251 operator=(basic_string&&) =
default;
255 operator=(
const _CharT* __s)
257 __glibcxx_check_string(__s);
264 operator=(_CharT __c)
271 #if __cplusplus >= 201103L 287 begin()
const _GLIBCXX_NOEXCEPT
295 end()
const _GLIBCXX_NOEXCEPT
296 {
return const_iterator(
_Base::end(),
this); }
300 {
return reverse_iterator(end()); }
302 const_reverse_iterator
303 rbegin()
const _GLIBCXX_NOEXCEPT
304 {
return const_reverse_iterator(end()); }
308 {
return reverse_iterator(begin()); }
310 const_reverse_iterator
311 rend()
const _GLIBCXX_NOEXCEPT
312 {
return const_reverse_iterator(begin()); }
314 #if __cplusplus >= 201103L 316 cbegin()
const noexcept
320 cend()
const noexcept
321 {
return const_iterator(
_Base::end(),
this); }
323 const_reverse_iterator
324 crbegin()
const noexcept
325 {
return const_reverse_iterator(end()); }
327 const_reverse_iterator
328 crend()
const noexcept
329 {
return const_reverse_iterator(begin()); }
338 resize(size_type __n, _CharT __c)
345 resize(size_type __n)
346 { this->resize(__n, _CharT()); }
348 #if __cplusplus >= 201103L 350 shrink_to_fit() noexcept
379 operator[](size_type __pos)
const _GLIBCXX_NOEXCEPT
381 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
382 _M_message(__gnu_debug::__msg_subscript_oob)
383 ._M_sequence(*
this,
"this")
384 ._M_integer(__pos,
"__pos")
385 ._M_integer(this->
size(),
"size"));
390 operator[](size_type __pos)
392 #if __cplusplus < 201103L && defined(_GLIBCXX_DEBUG_PEDANTIC) 393 __glibcxx_check_subscript(__pos);
396 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
397 _M_message(__gnu_debug::__msg_subscript_oob)
398 ._M_sequence(*
this,
"this")
399 ._M_integer(__pos,
"__pos")
400 ._M_integer(this->
size(),
"size"));
407 #if __cplusplus >= 201103L 414 operator+=(
const basic_string& __str)
422 operator+=(
const _CharT* __s)
424 __glibcxx_check_string(__s);
431 operator+=(_CharT __c)
438 #if __cplusplus >= 201103L 449 append(
const basic_string& __str)
457 append(
const basic_string& __str, size_type __pos, size_type __n)
465 append(
const _CharT* __s, size_type __n)
467 __glibcxx_check_string_len(__s, __n);
474 append(
const _CharT* __s)
476 __glibcxx_check_string(__s);
483 append(size_type __n, _CharT __c)
490 template<
typename _InputIterator>
492 append(_InputIterator __first, _InputIterator __last)
495 __glibcxx_check_valid_range2(__first, __last, __dist);
497 if (__dist.
second >= __dp_sign)
499 __gnu_debug::__unsafe(__last));
510 push_back(_CharT __c)
517 assign(
const basic_string& __x)
524 #if __cplusplus >= 201103L 526 assign(basic_string&& __x)
527 noexcept(noexcept(std::declval<_Base&>().assign(
std::move(__x))))
536 assign(
const basic_string& __str, size_type __pos, size_type __n)
544 assign(
const _CharT* __s, size_type __n)
546 __glibcxx_check_string_len(__s, __n);
553 assign(
const _CharT* __s)
555 __glibcxx_check_string(__s);
562 assign(size_type __n, _CharT __c)
569 template<
typename _InputIterator>
571 assign(_InputIterator __first, _InputIterator __last)
574 __glibcxx_check_valid_range2(__first, __last, __dist);
576 if (__dist.
second >= __dp_sign)
578 __gnu_debug::__unsafe(__last));
586 #if __cplusplus >= 201103L 597 insert(size_type __pos1,
const basic_string& __str)
605 insert(size_type __pos1,
const basic_string& __str,
606 size_type __pos2, size_type __n)
614 insert(size_type __pos,
const _CharT* __s, size_type __n)
616 __glibcxx_check_string(__s);
623 insert(size_type __pos,
const _CharT* __s)
625 __glibcxx_check_string(__s);
632 insert(size_type __pos, size_type __n, _CharT __c)
640 insert(__const_iterator __p, _CharT __c)
645 return iterator(__res,
this);
648 #if __cplusplus >= 201103L 650 insert(const_iterator __p, size_type __n, _CharT __c)
653 #if _GLIBCXX_USE_CXX11_ABI 658 typename _Base::iterator __res =
_Base::begin() + __offset;
661 return iterator(__res,
this);
665 insert(iterator __p, size_type __n, _CharT __c)
673 template<
typename _InputIterator>
675 insert(__const_iterator __p,
676 _InputIterator __first, _InputIterator __last)
681 typename _Base::iterator __res;
682 #if ! _GLIBCXX_INSERT_RETURNS_ITERATOR 685 if (__dist.
second >= __dp_sign)
687 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
689 __gnu_debug::__unsafe(__last));
693 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
697 #if ! _GLIBCXX_INSERT_RETURNS_ITERATOR 701 return iterator(__res,
this);
704 #if __cplusplus >= 201103L 709 #if _GLIBCXX_USE_CXX11_ABI 717 return iterator(__res,
this);
722 erase(size_type __pos = 0, size_type __n =
_Base::npos)
730 erase(__const_iterator __position)
735 return iterator(__res,
this);
739 erase(__const_iterator __first, __const_iterator __last)
747 return iterator(__res,
this);
750 #if __cplusplus >= 201103L 754 __glibcxx_check_nonempty();
761 replace(size_type __pos1, size_type __n1,
const basic_string& __str)
769 replace(size_type __pos1, size_type __n1,
const basic_string& __str,
770 size_type __pos2, size_type __n2)
778 replace(size_type __pos, size_type __n1,
const _CharT* __s,
781 __glibcxx_check_string_len(__s, __n2);
788 replace(size_type __pos, size_type __n1,
const _CharT* __s)
790 __glibcxx_check_string(__s);
797 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
805 replace(__const_iterator __i1, __const_iterator __i2,
806 const basic_string& __str)
815 replace(__const_iterator __i1, __const_iterator __i2,
816 const _CharT* __s, size_type __n)
819 __glibcxx_check_string_len(__s, __n);
826 replace(__const_iterator __i1, __const_iterator __i2,
830 __glibcxx_check_string(__s);
837 replace(__const_iterator __i1, __const_iterator __i2,
838 size_type __n, _CharT __c)
846 template<
typename _InputIterator>
848 replace(__const_iterator __i1, __const_iterator __i2,
849 _InputIterator __j1, _InputIterator __j2)
854 __glibcxx_check_valid_range2(__j1, __j2, __dist);
856 if (__dist.
second >= __dp_sign)
858 __gnu_debug::__unsafe(__j1),
859 __gnu_debug::__unsafe(__j2));
867 #if __cplusplus >= 201103L 869 replace(__const_iterator __i1, __const_iterator __i2,
880 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const 882 __glibcxx_check_string_len(__s, __n);
887 swap(basic_string& __x)
888 _GLIBCXX_NOEXCEPT_IF(std::__is_nothrow_swappable<_Base>::value)
896 c_str()
const _GLIBCXX_NOEXCEPT
904 data()
const _GLIBCXX_NOEXCEPT
917 find(
const _CharT* __s, size_type __pos, size_type __n)
const 920 __glibcxx_check_string(__s);
926 find(
const _CharT* __s, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
928 __glibcxx_check_string(__s);
936 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const 938 __glibcxx_check_string_len(__s, __n);
944 rfind(
const _CharT* __s, size_type __pos =
_Base::npos)
const 946 __glibcxx_check_string(__s);
954 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const 957 __glibcxx_check_string(__s);
963 find_first_of(
const _CharT* __s, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
965 __glibcxx_check_string(__s);
973 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const 976 __glibcxx_check_string(__s);
982 find_last_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const 985 __glibcxx_check_string(__s);
993 find_first_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const 996 __glibcxx_check_string_len(__s, __n);
1000 _GLIBCXX20_CONSTEXPR
1002 find_first_not_of(
const _CharT* __s, size_type __pos = 0)
const 1005 __glibcxx_check_string(__s);
1011 _GLIBCXX20_CONSTEXPR
1013 find_last_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const 1016 __glibcxx_check_string(__s);
1020 _GLIBCXX20_CONSTEXPR
1022 find_last_not_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const 1025 __glibcxx_check_string(__s);
1030 substr(size_type __pos = 0, size_type __n =
_Base::npos)
const 1035 _GLIBCXX20_CONSTEXPR
1037 compare(
const _CharT* __s)
const _GLIBCXX_NOEXCEPT
1039 __glibcxx_check_string(__s);
1045 _GLIBCXX20_CONSTEXPR
1047 compare(size_type __pos1, size_type __n1,
const _CharT* __s)
const 1049 __glibcxx_check_string(__s);
1055 _GLIBCXX20_CONSTEXPR
1057 compare(size_type __pos1, size_type __n1,
const _CharT* __s,
1058 size_type __n2)
const 1060 __glibcxx_check_string_len(__s, __n2);
1065 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
1068 _M_base()
const _GLIBCXX_NOEXCEPT {
return *
this; }
1070 using _Safe::_M_invalidate_all;
1073 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1079 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1081 operator+(
const _CharT* __lhs,
1084 __glibcxx_check_string(__lhs);
1088 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1090 operator+(_CharT __lhs,
1094 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1097 const _CharT* __rhs)
1099 __glibcxx_check_string(__rhs);
1103 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1109 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1113 {
return __lhs._M_base() == __rhs._M_base(); }
1115 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1117 operator==(
const _CharT* __lhs,
1120 __glibcxx_check_string(__lhs);
1121 return __lhs == __rhs._M_base();
1124 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1127 const _CharT* __rhs)
1129 __glibcxx_check_string(__rhs);
1130 return __lhs._M_base() == __rhs;
1133 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1137 {
return __lhs._M_base() != __rhs._M_base(); }
1139 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1141 operator!=(
const _CharT* __lhs,
1144 __glibcxx_check_string(__lhs);
1145 return __lhs != __rhs._M_base();
1148 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1151 const _CharT* __rhs)
1153 __glibcxx_check_string(__rhs);
1154 return __lhs._M_base() != __rhs;
1157 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1159 operator<(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1161 {
return __lhs._M_base() < __rhs._M_base(); }
1163 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1165 operator<(
const _CharT* __lhs,
1168 __glibcxx_check_string(__lhs);
1169 return __lhs < __rhs._M_base();
1172 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1174 operator<(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1175 const _CharT* __rhs)
1177 __glibcxx_check_string(__rhs);
1178 return __lhs._M_base() < __rhs;
1181 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1183 operator<=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1185 {
return __lhs._M_base() <= __rhs._M_base(); }
1187 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1189 operator<=(
const _CharT* __lhs,
1192 __glibcxx_check_string(__lhs);
1193 return __lhs <= __rhs._M_base();
1196 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1198 operator<=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1199 const _CharT* __rhs)
1201 __glibcxx_check_string(__rhs);
1202 return __lhs._M_base() <= __rhs;
1205 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1209 {
return __lhs._M_base() >= __rhs._M_base(); }
1211 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1213 operator>=(
const _CharT* __lhs,
1216 __glibcxx_check_string(__lhs);
1217 return __lhs >= __rhs._M_base();
1220 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1223 const _CharT* __rhs)
1225 __glibcxx_check_string(__rhs);
1226 return __lhs._M_base() >= __rhs;
1229 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1233 {
return __lhs._M_base() > __rhs._M_base(); }
1235 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1237 operator>(
const _CharT* __lhs,
1240 __glibcxx_check_string(__lhs);
1241 return __lhs > __rhs._M_base();
1244 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1247 const _CharT* __rhs)
1249 __glibcxx_check_string(__rhs);
1250 return __lhs._M_base() > __rhs;
1254 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1258 { __lhs.swap(__rhs); }
1260 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1262 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1264 {
return __os << __str._M_base(); }
1266 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1276 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1288 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1303 #ifdef _GLIBCXX_USE_CHAR8_T 1308 #if __cplusplus >= 201103L 1316 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1317 struct _Insert_range_from_self_is_safe<
1319 {
enum { __value = 1 }; };
1323 #if __cplusplus >= 201103L 1324 namespace std _GLIBCXX_VISIBILITY(default)
1326 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1329 template<
typename _CharT>
1331 :
public hash<std::basic_string<_CharT>>
1334 template<
typename _CharT>
1339 #ifdef __glibcxx_erase_if // C++ >= 20 && HOSTED 1340 template<
typename _CharT,
typename _Traits,
typename _Alloc,
1341 typename _Predicate>
1343 _Traits, _Alloc>::size_type
1347 return __detail::__erase_if(__cont, __cont._M_base(),
std::move(__pred));
1350 template<
typename _CharT,
typename _Traits,
typename _Alloc,
1351 typename _Up _GLIBCXX26_DEF_VAL_T(_CharT)>
1353 _Traits, _Alloc>::size_type
1356 {
return std::erase_if(__cont, __gnu_cxx::__ops::__equal_to(__value)); }
1357 #endif // __glibcxx_erase_if 1359 _GLIBCXX_END_NAMESPACE_VERSION
1363 #undef _GLIBCXX_INSERT_RETURNS_ITERATOR 1364 #undef _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY
void reserve()
Equivalent to shrink_to_fit().
size_type find_first_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character of string.
size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
basic_string & replace(size_type __pos, size_type __n, const basic_string &__str)
Replace characters with value from another string.
void push_back(_CharT __c)
Append a single character.
bool empty() const noexcept
void insert(iterator __p, size_type __n, _CharT __c)
Insert multiple characters.
size_type length() const noexcept
Returns the number of characters in the string, not including any null-termination.
#define __glibcxx_check_erase_range(_First, _Last)
basic_string & operator=(const basic_string &__str)
Assign the value of str to this string.
basic_string & operator+=(const basic_string &__str)
Append a string to this string.
const _CharT * data() const noexcept
Return const pointer to contents.
const _CharT * __check_string(const _CharT *__s, _Integer __n, const char *__file, unsigned int __line, const char *__function)
#define __glibcxx_check_erase(_Position)
const _CharT * c_str() const noexcept
Return const pointer to null-terminated contents.
int compare(const basic_string &__str) const
Compare to a string.
#define __glibcxx_check_insert(_Position)
Template class basic_ostream.
ISO C++ entities toplevel namespace is std.
basic_string & append(const basic_string &__str)
Append a string to this string.
basic_string< char32_t > u32string
A string of char32_t.
static const size_type npos
Value returned by various member functions when they fail.
size_type max_size() const noexcept
Returns the size() of the largest possible string.
GNU debug classes for public use.
Struct holding two objects of arbitrary type.
basic_string< char16_t > u16string
A string of char16_t.
Safe class dealing with some allocator dependent operations.
Base class for constructing a safe sequence type that tracks iterators that reference it...
void swap(basic_string &__s) noexcept(/*conditional */)
Swap contents with another string.
void resize(size_type __n, _CharT __c)
Resizes the string to the specified number of characters.
const_reference operator[](size_type __pos) const noexcept
Subscript access to the data contained in the string.
basic_string substr(size_type __pos=0, size_type __n=npos) const
Get a substring.
size_type find(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find position of a C substring.
Class std::basic_string with safety/checking/debug instrumentation.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
basic_string & erase(size_type __pos=0, size_type __n=npos)
Remove characters.
void pop_back()
Remove the last character.
size_type copy(_CharT *__s, size_type __n, size_type __pos=0) const
Copy substring into C string.
Template class basic_istream.
#define __glibcxx_check_insert_range(_Position, _First, _Last, _Dist)
allocator_type get_allocator() const noexcept
Return copy of allocator used to construct this string.
constexpr _Iterator & base() noexcept
Return the underlying iterator.
Primary class template hash.
_T2 second
The second member.
basic_string & assign(const basic_string &__str)
Set value to contents of another string.
size_type find_last_of(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a character of string.
constexpr _Iterator __base(_Iterator __it)
size_type find_last_not_of(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a character not in string.
size_type find_first_not_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character not in string.
const_reference at(size_type __n) const
Provides access to the data contained in the string.
Managing sequences of characters and character-like objects.
size_type capacity() const noexcept
constexpr void _M_invalidate_all() const
const_iterator cbegin() const noexcept
size_type rfind(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a string.