29 #ifndef _GLIBCXX_DEBUG_STRING
30 #define _GLIBCXX_DEBUG_STRING 1
32 #pragma GCC system_header
39 #define _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(_Cond,_File,_Line,_Func) \
41 __gnu_debug::_Error_formatter::_S_at(_File, _Line, _Func) \
42 ._M_message(#_Cond)._M_error()
44 #if _GLIBCXX_USE_CXX11_ABI && __cplusplus >= 201103
45 # define _GLIBCXX_INSERT_RETURNS_ITERATOR 1
46 # define _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(expr) expr
48 # define _GLIBCXX_INSERT_RETURNS_ITERATOR 0
49 # define _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(expr)
55 template<
typename _CharT,
typename _Integer>
58 _Integer __n __attribute__((__unused__)),
59 const char* __file __attribute__((__unused__)),
60 unsigned int __line __attribute__((__unused__)),
61 const char* __function __attribute__((__unused__)))
63 #ifdef _GLIBCXX_DEBUG_PEDANTIC
64 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(__s != 0 || __n == 0,
65 __file, __line, __function);
71 template<
typename _CharT>
74 const char* __file __attribute__((__unused__)),
75 unsigned int __line __attribute__((__unused__)),
76 const char* __function __attribute__((__unused__)))
78 #ifdef _GLIBCXX_DEBUG_PEDANTIC
79 _GLIBCXX_DEBUG_VERIFY_STR_COND_AT(__s != 0,
80 __file, __line, __function);
85 #define __glibcxx_check_string_n_constructor(_Str, _Size) \
86 __check_string(_Str, _Size, __FILE__, __LINE__, __PRETTY_FUNCTION__)
88 #define __glibcxx_check_string_constructor(_Str) \
89 __check_string(_Str, __FILE__, __LINE__, __PRETTY_FUNCTION__)
92 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT>,
93 typename _Allocator = std::allocator<_CharT> >
96 basic_string<_CharT, _Traits, _Allocator>,
97 _Allocator, _Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>,
105 template<
typename _ItT,
typename _SeqT,
typename _CatT>
106 friend class ::__gnu_debug::_Safe_iterator;
114 typedef _Traits traits_type;
115 typedef typename _Traits::char_type value_type;
116 typedef _Allocator allocator_type;
117 typedef typename _Base::size_type size_type;
118 typedef typename _Base::difference_type difference_type;
119 typedef typename _Base::reference reference;
120 typedef typename _Base::const_reference const_reference;
121 typedef typename _Base::pointer pointer;
122 typedef typename _Base::const_pointer const_pointer;
140 #if __cplusplus < 201103L
153 const _Allocator& __a = _Allocator())
158 :
_Base(__s, __a) { }
182 const _Allocator& __a = _Allocator())
183 :
_Base(__str, __pos, __n, __a) { }
186 const _Allocator& __a = _Allocator())
187 :
_Base(__glibcxx_check_string_n_constructor(__s, __n), __n, __a) { }
189 basic_string(
const _CharT* __s,
const _Allocator& __a = _Allocator())
190 :
_Base(__glibcxx_check_string_constructor(__s), __a)
194 const _Allocator& __a = _Allocator())
195 :
_Base(__n, __c, __a) { }
197 template<
typename _InputIterator>
198 basic_string(_InputIterator __begin, _InputIterator __end,
199 const _Allocator& __a = _Allocator())
201 __glibcxx_check_valid_constructor_range(__begin, __end)),
204 #if __cplusplus >= 201103L
213 operator=(
const _CharT* __s)
215 __glibcxx_check_string(__s);
222 operator=(_CharT __c)
229 #if __cplusplus >= 201103L
245 begin()
const _GLIBCXX_NOEXCEPT
253 end()
const _GLIBCXX_NOEXCEPT
261 rbegin()
const _GLIBCXX_NOEXCEPT
269 rend()
const _GLIBCXX_NOEXCEPT
272 #if __cplusplus >= 201103L
274 cbegin()
const noexcept
278 cend()
const noexcept
282 crbegin()
const noexcept
286 crend()
const noexcept
296 resize(size_type __n, _CharT __c)
303 resize(size_type __n)
304 { this->resize(__n, _CharT()); }
306 #if __cplusplus >= 201103L
308 shrink_to_fit() noexcept
337 operator[](size_type __pos)
const _GLIBCXX_NOEXCEPT
339 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
340 _M_message(__gnu_debug::__msg_subscript_oob)
341 ._M_sequence(*
this,
"this")
342 ._M_integer(__pos,
"__pos")
343 ._M_integer(this->
size(),
"size"));
348 operator[](size_type __pos)
350 #if __cplusplus < 201103L && defined(_GLIBCXX_DEBUG_PEDANTIC)
351 __glibcxx_check_subscript(__pos);
354 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
355 _M_message(__gnu_debug::__msg_subscript_oob)
356 ._M_sequence(*
this,
"this")
357 ._M_integer(__pos,
"__pos")
358 ._M_integer(this->
size(),
"size"));
365 #if __cplusplus >= 201103L
380 operator+=(
const _CharT* __s)
382 __glibcxx_check_string(__s);
389 operator+=(_CharT __c)
396 #if __cplusplus >= 201103L
415 append(
const basic_string& __str, size_type __pos, size_type __n)
423 append(
const _CharT* __s, size_type __n)
425 __glibcxx_check_string_len(__s, __n);
432 append(
const _CharT* __s)
434 __glibcxx_check_string(__s);
441 append(size_type __n, _CharT __c)
448 template<
typename _InputIterator>
450 append(_InputIterator __first, _InputIterator __last)
453 __glibcxx_check_valid_range2(__first, __last, __dist);
455 if (__dist.
second >= __dp_sign)
457 __gnu_debug::__unsafe(__last));
468 push_back(_CharT __c)
482 #if __cplusplus >= 201103L
485 noexcept(noexcept(std::declval<_Base&>().assign(
std::move(__x))))
494 assign(
const basic_string& __str, size_type __pos, size_type __n)
502 assign(
const _CharT* __s, size_type __n)
504 __glibcxx_check_string_len(__s, __n);
511 assign(
const _CharT* __s)
513 __glibcxx_check_string(__s);
520 assign(size_type __n, _CharT __c)
527 template<
typename _InputIterator>
529 assign(_InputIterator __first, _InputIterator __last)
532 __glibcxx_check_valid_range2(__first, __last, __dist);
534 if (__dist.
second >= __dp_sign)
536 __gnu_debug::__unsafe(__last));
544 #if __cplusplus >= 201103L
564 size_type __pos2, size_type __n)
572 insert(size_type __pos,
const _CharT* __s, size_type __n)
574 __glibcxx_check_string(__s);
581 insert(size_type __pos,
const _CharT* __s)
583 __glibcxx_check_string(__s);
590 insert(size_type __pos, size_type __n, _CharT __c)
603 return iterator(__res,
this);
606 #if __cplusplus >= 201103L
611 #if _GLIBCXX_USE_CXX11_ABI
616 typename _Base::iterator __res =
_Base::begin() + __offset;
619 return iterator(__res,
this);
623 insert(
iterator __p, size_type __n, _CharT __c)
631 template<
typename _InputIterator>
634 _InputIterator __first, _InputIterator __last)
639 typename _Base::iterator __res;
640 #if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
643 if (__dist.
second >= __dp_sign)
645 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
647 __gnu_debug::__unsafe(__last));
651 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
655 #if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
659 return iterator(__res,
this);
662 #if __cplusplus >= 201103L
667 #if _GLIBCXX_USE_CXX11_ABI
675 return iterator(__res,
this);
680 erase(size_type __pos = 0, size_type __n =
_Base::npos)
693 return iterator(__res,
this);
702 typename _Base::iterator __res =
_Base::erase(__first.base(),
705 return iterator(__res,
this);
708 #if __cplusplus >= 201103L
712 __glibcxx_check_nonempty();
719 replace(size_type __pos1, size_type __n1,
const basic_string& __str)
727 replace(size_type __pos1, size_type __n1,
const basic_string& __str,
728 size_type __pos2, size_type __n2)
736 replace(size_type __pos, size_type __n1,
const _CharT* __s,
739 __glibcxx_check_string_len(__s, __n2);
746 replace(size_type __pos, size_type __n1,
const _CharT* __s)
748 __glibcxx_check_string(__s);
755 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
774 const _CharT* __s, size_type __n)
777 __glibcxx_check_string_len(__s, __n);
788 __glibcxx_check_string(__s);
796 size_type __n, _CharT __c)
804 template<
typename _InputIterator>
807 _InputIterator __j1, _InputIterator __j2)
812 __glibcxx_check_valid_range2(__j1, __j2, __dist);
814 if (__dist.
second >= __dp_sign)
816 __gnu_debug::__unsafe(__j1),
817 __gnu_debug::__unsafe(__j2));
825 #if __cplusplus >= 201103L
838 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const
840 __glibcxx_check_string_len(__s, __n);
846 _GLIBCXX_NOEXCEPT_IF(std::__is_nothrow_swappable<_Base>::value)
854 c_str()
const _GLIBCXX_NOEXCEPT
862 data()
const _GLIBCXX_NOEXCEPT
872 find(
const basic_string& __str, size_type __pos = 0)
const
877 find(
const _CharT* __s, size_type __pos, size_type __n)
const
879 __glibcxx_check_string(__s);
884 find(
const _CharT* __s, size_type __pos = 0)
const
886 __glibcxx_check_string(__s);
891 find(_CharT __c, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
900 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const
902 __glibcxx_check_string_len(__s, __n);
907 rfind(
const _CharT* __s, size_type __pos =
_Base::npos)
const
909 __glibcxx_check_string(__s);
914 rfind(_CharT __c, size_type __pos =
_Base::npos)
const _GLIBCXX_NOEXCEPT
918 find_first_of(
const basic_string& __str, size_type __pos = 0)
const
923 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const
925 __glibcxx_check_string(__s);
930 find_first_of(
const _CharT* __s, size_type __pos = 0)
const
932 __glibcxx_check_string(__s);
937 find_first_of(_CharT __c, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
942 size_type __pos =
_Base::npos)
const _GLIBCXX_NOEXCEPT
946 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const
948 __glibcxx_check_string(__s);
953 find_last_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
955 __glibcxx_check_string(__s);
960 find_last_of(_CharT __c, size_type __pos =
_Base::npos)
const
965 find_first_not_of(
const basic_string& __str, size_type __pos = 0)
const
970 find_first_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
972 __glibcxx_check_string_len(__s, __n);
977 find_first_not_of(
const _CharT* __s, size_type __pos = 0)
const
979 __glibcxx_check_string(__s);
984 find_first_not_of(_CharT __c, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
994 find_last_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
996 __glibcxx_check_string(__s);
1001 find_last_not_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
1003 __glibcxx_check_string(__s);
1008 find_last_not_of(_CharT __c, size_type __pos =
_Base::npos)
const
1013 substr(size_type __pos = 0, size_type __n =
_Base::npos)
const
1021 compare(size_type __pos1, size_type __n1,
1026 compare(size_type __pos1, size_type __n1,
const basic_string& __str,
1027 size_type __pos2, size_type __n2)
const
1031 compare(
const _CharT* __s)
const
1033 __glibcxx_check_string(__s);
1040 compare(size_type __pos1, size_type __n1,
const _CharT* __s)
const
1042 __glibcxx_check_string(__s);
1049 compare(size_type __pos1, size_type __n1,
const _CharT* __s,
1050 size_type __n2)
const
1052 __glibcxx_check_string_len(__s, __n2);
1057 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
1060 _M_base()
const _GLIBCXX_NOEXCEPT {
return *
this; }
1062 using _Safe::_M_invalidate_all;
1065 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1071 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1072 inline basic_string<_CharT,_Traits,_Allocator>
1073 operator+(
const _CharT* __lhs,
1074 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1076 __glibcxx_check_string(__lhs);
1077 return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs;
1080 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1081 inline basic_string<_CharT,_Traits,_Allocator>
1083 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1084 {
return basic_string<_CharT,_Traits,_Allocator>(1, __lhs) += __rhs; }
1086 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1087 inline basic_string<_CharT,_Traits,_Allocator>
1088 operator+(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1089 const _CharT* __rhs)
1091 __glibcxx_check_string(__rhs);
1092 return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs;
1095 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1096 inline basic_string<_CharT,_Traits,_Allocator>
1097 operator+(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1099 {
return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs; }
1101 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1103 operator==(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1104 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1105 {
return __lhs._M_base() == __rhs._M_base(); }
1107 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1109 operator==(
const _CharT* __lhs,
1110 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1112 __glibcxx_check_string(__lhs);
1113 return __lhs == __rhs._M_base();
1116 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1118 operator==(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1119 const _CharT* __rhs)
1121 __glibcxx_check_string(__rhs);
1122 return __lhs._M_base() == __rhs;
1125 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1127 operator!=(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1128 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1129 {
return __lhs._M_base() != __rhs._M_base(); }
1131 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1133 operator!=(
const _CharT* __lhs,
1134 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1136 __glibcxx_check_string(__lhs);
1137 return __lhs != __rhs._M_base();
1140 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1142 operator!=(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1143 const _CharT* __rhs)
1145 __glibcxx_check_string(__rhs);
1146 return __lhs._M_base() != __rhs;
1149 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1151 operator<(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1152 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1153 {
return __lhs._M_base() < __rhs._M_base(); }
1155 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1157 operator<(
const _CharT* __lhs,
1158 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1160 __glibcxx_check_string(__lhs);
1161 return __lhs < __rhs._M_base();
1164 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1166 operator<(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1167 const _CharT* __rhs)
1169 __glibcxx_check_string(__rhs);
1170 return __lhs._M_base() < __rhs;
1173 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1175 operator<=(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1176 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1177 {
return __lhs._M_base() <= __rhs._M_base(); }
1179 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1181 operator<=(
const _CharT* __lhs,
1182 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1184 __glibcxx_check_string(__lhs);
1185 return __lhs <= __rhs._M_base();
1188 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1190 operator<=(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1191 const _CharT* __rhs)
1193 __glibcxx_check_string(__rhs);
1194 return __lhs._M_base() <= __rhs;
1197 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1199 operator>=(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1200 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1201 {
return __lhs._M_base() >= __rhs._M_base(); }
1203 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1205 operator>=(
const _CharT* __lhs,
1206 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1208 __glibcxx_check_string(__lhs);
1209 return __lhs >= __rhs._M_base();
1212 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1214 operator>=(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1215 const _CharT* __rhs)
1217 __glibcxx_check_string(__rhs);
1218 return __lhs._M_base() >= __rhs;
1221 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1223 operator>(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1224 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1225 {
return __lhs._M_base() > __rhs._M_base(); }
1227 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1229 operator>(
const _CharT* __lhs,
1230 const basic_string<_CharT,_Traits,_Allocator>& __rhs)
1232 __glibcxx_check_string(__lhs);
1233 return __lhs > __rhs._M_base();
1236 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1238 operator>(
const basic_string<_CharT,_Traits,_Allocator>& __lhs,
1239 const _CharT* __rhs)
1241 __glibcxx_check_string(__rhs);
1242 return __lhs._M_base() > __rhs;
1246 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1248 swap(basic_string<_CharT,_Traits,_Allocator>& __lhs,
1249 basic_string<_CharT,_Traits,_Allocator>& __rhs)
1250 { __lhs.swap(__rhs); }
1252 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1255 const basic_string<_CharT, _Traits, _Allocator>& __str)
1256 {
return __os << __str._M_base(); }
1258 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1261 basic_string<_CharT,_Traits,_Allocator>& __str)
1264 __str._M_invalidate_all();
1268 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1271 basic_string<_CharT,_Traits,_Allocator>& __str, _CharT __delim)
1276 __str._M_invalidate_all();
1280 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1283 basic_string<_CharT,_Traits,_Allocator>& __str)
1287 __str._M_invalidate_all();
1291 typedef basic_string<char>
string;
1293 typedef basic_string<wchar_t>
wstring;
1295 #ifdef _GLIBCXX_USE_CHAR8_T
1297 typedef basic_string<char8_t> u8string;
1300 #if __cplusplus >= 201103L
1308 template<
typename _CharT,
typename _Traits,
typename _Allocator>
1309 struct _Insert_range_from_self_is_safe<
1311 {
enum { __value = 1 }; };
1315 #if __cplusplus >= 201103L
1316 namespace std _GLIBCXX_VISIBILITY(default)
1318 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1321 template<
typename _CharT>
1323 :
public hash<std::basic_string<_CharT>>
1326 template<
typename _CharT>
1328 : __is_fast_hash<hash<std::basic_string<_CharT>>>
1331 _GLIBCXX_END_NAMESPACE_VERSION
1335 #undef _GLIBCXX_INSERT_RETURNS_ITERATOR
1336 #undef _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY
#define __glibcxx_check_insert(_Position)
#define __glibcxx_check_erase_range(_First, _Last)
#define __glibcxx_check_erase(_Position)
#define __glibcxx_check_insert_range(_Position, _First, _Last, _Dist)
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
basic_string< char > string
A string of char.
basic_string< wchar_t > wstring
A string of wchar_t.
ISO C++ entities toplevel namespace is std.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
basic_istream< _CharT, _Traits > & getline(basic_istream< _CharT, _Traits > &__is, basic_string< _CharT, _Traits, _Alloc > &__str, _CharT __delim)
Read a line from stream into a string.
GNU debug classes for public use.
basic_string< char32_t > u32string
A string of char32_t.
const _CharT * __check_string(const _CharT *__s, _Integer __n, const char *__file, unsigned int __line, const char *__function)
constexpr _Iterator __base(_Iterator __it)
basic_string< char16_t > u16string
A string of char16_t.
Template class basic_istream.
Template class basic_ostream.
Primary class template hash.
_Iterator & base() noexcept
Return the underlying iterator.
Managing sequences of characters and character-like objects.
void swap(basic_string &__s) noexcept(/*conditional */)
Swap contents with another string.
void push_back(_CharT __c)
Append a single character.
size_type find_first_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character of string.
const _CharT * c_str() const noexcept
Return const pointer to null-terminated contents.
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.
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.
int compare(const basic_string &__str) const
Compare to a 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.
void insert(iterator __p, size_type __n, _CharT __c)
Insert multiple characters.
basic_string & operator+=(const basic_string &__str)
Append a string to this string.
basic_string & assign(const basic_string &__str)
Set value to contents of another string.
basic_string & replace(size_type __pos, size_type __n, const basic_string &__str)
Replace characters with value from another string.
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.
size_type length() const noexcept
Returns the number of characters in the string, not including any null-termination.
size_type find_last_of(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a character of string.
size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
size_type rfind(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a string.
void resize(size_type __n, _CharT __c)
Resizes the string to the specified number of characters.
void reserve()
Equivalent to shrink_to_fit().
const _CharT * data() const noexcept
Return const pointer to contents.
const_reference at(size_type __n) const
Provides access to the data contained in the string.
basic_string & append(const basic_string &__str)
Append a string to this string.
basic_string & operator=(const basic_string &__str)
Assign the value of str to this string.
const_reference operator[](size_type __pos) const noexcept
Subscript access to the data contained in the string.
bool empty() const noexcept
static const size_type npos
Value returned by various member functions when they fail.
allocator_type get_allocator() const noexcept
Return copy of allocator used to construct this string.
const_iterator cbegin() const noexcept
basic_string & erase(size_type __pos=0, size_type __n=npos)
Remove characters.
size_type capacity() const noexcept
size_type max_size() const noexcept
Returns the size() of the largest possible string.
Struct holding two objects of arbitrary type.
_T2 second
The second member.
Base class for constructing a safe sequence type that tracks iterators that reference it.
void _M_invalidate_all() const
Safe class dealing with some allocator dependent operations.
Class std::basic_string with safety/checking/debug instrumentation.
void reserve(size_type __res_arg)
Attempt to preallocate enough memory for specified number of characters.
size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
size_type capacity() const noexcept