39#ifndef _BASIC_STRING_TCC
40#define _BASIC_STRING_TCC 1
43#pragma GCC system_header
46#pragma GCC diagnostic push
47#pragma GCC diagnostic ignored "-Wc++11-extensions"
51namespace std _GLIBCXX_VISIBILITY(default)
53_GLIBCXX_BEGIN_NAMESPACE_VERSION
55#if _GLIBCXX_USE_CXX11_ABI
57 template<
typename _CharT,
typename _Traits,
typename _Alloc>
58 const typename basic_string<_CharT, _Traits, _Alloc>::size_type
61 template<
typename _CharT,
typename _Traits,
typename _Alloc>
70 _Alloc_traits::_S_on_swap(_M_get_allocator(), __s._M_get_allocator());
73 if (__s._M_is_local())
75 if (length() && __s.length())
77 _CharT __tmp_data[_S_local_capacity + 1];
78 traits_type::copy(__tmp_data, __s._M_local_buf,
80 traits_type::copy(__s._M_local_buf, _M_local_buf,
82 traits_type::copy(_M_local_buf, __tmp_data,
85 else if (__s.length())
88 traits_type::copy(_M_local_buf, __s._M_local_buf,
90 _M_length(__s.length());
96 __s._M_init_local_buf();
97 traits_type::copy(__s._M_local_buf, _M_local_buf,
99 __s._M_length(length());
106 const size_type __tmp_capacity = __s._M_allocated_capacity;
107 __s._M_init_local_buf();
108 traits_type::copy(__s._M_local_buf, _M_local_buf,
110 _M_data(__s._M_data());
111 __s._M_data(__s._M_local_buf);
112 _M_capacity(__tmp_capacity);
116 const size_type __tmp_capacity = _M_allocated_capacity;
117 if (__s._M_is_local())
120 traits_type::copy(_M_local_buf, __s._M_local_buf,
122 __s._M_data(_M_data());
123 _M_data(_M_local_buf);
127 pointer __tmp_ptr = _M_data();
128 _M_data(__s._M_data());
129 __s._M_data(__tmp_ptr);
130 _M_capacity(__s._M_allocated_capacity);
132 __s._M_capacity(__tmp_capacity);
136 _M_length(__s.length());
137 __s._M_length(__tmp_length);
140 template<
typename _CharT,
typename _Traits,
typename _Alloc>
142 typename basic_string<_CharT, _Traits, _Alloc>::pointer
148 if (__capacity > max_size())
149 std::__throw_length_error(__N(
"basic_string::_M_create"));
154 if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
156 __capacity = 2 * __old_capacity;
158 if (__capacity > max_size())
159 __capacity = max_size();
164 return _S_allocate(_M_get_allocator(), __capacity + 1);
171 template<
typename _CharT,
typename _Traits,
typename _Alloc>
172 template<
typename _InIterator>
177 std::input_iterator_tag)
184 while (__beg != __end && __len < __capacity)
186 _M_local_buf[__len++] = *__beg;
193 explicit _Guard(basic_string* __s) : _M_guarded(__s) { }
196 ~_Guard() {
if (_M_guarded) _M_guarded->_M_dispose(); }
198 basic_string* _M_guarded;
201 while (__beg != __end)
203 if (__len == __capacity)
206 __capacity = __len + 1;
207 pointer __another = _M_create(__capacity, __len);
208 this->_S_copy(__another, _M_data(), __len);
211 _M_capacity(__capacity);
213 traits_type::assign(_M_data()[__len++], *__beg);
217 __guard._M_guarded = 0;
219 _M_set_length(__len);
222 template<
typename _CharT,
typename _Traits,
typename _Alloc>
223 template<
typename _InIterator>
228 std::forward_iterator_tag)
232 if (__dnew >
size_type(_S_local_capacity))
234 _M_data(_M_create(__dnew,
size_type(0)));
244 explicit _Guard(basic_string* __s) : _M_guarded(__s) { }
247 ~_Guard() {
if (_M_guarded) _M_guarded->_M_dispose(); }
249 basic_string* _M_guarded;
252 this->_S_copy_chars(_M_data(), __beg, __end);
254 __guard._M_guarded = 0;
256 _M_set_length(__dnew);
259 template<
typename _CharT,
typename _Traits,
typename _Alloc>
274 this->_S_assign(_M_data(), __n, __c);
281 template<
typename _CharT,
typename _Traits,
typename _Alloc>
282 template<
bool _Terminated>
296 if (__n || _Terminated)
297 this->_S_copy(_M_data(), __str, __n + _Terminated);
301 traits_type::assign(_M_data()[__n], _CharT());
304 template<
typename _CharT,
typename _Traits,
typename _Alloc>
312 const size_type __rsize = __str.length();
315 if (__rsize > __capacity)
318 pointer __tmp = _M_create(__new_capacity, __capacity);
321 _M_capacity(__new_capacity);
325 this->_S_copy(_M_data(), __str._M_data(), __rsize);
327 _M_set_length(__rsize);
331 template<
typename _CharT,
typename _Traits,
typename _Alloc>
342 if (__res <= __capacity)
345 pointer __tmp = _M_create(__res, __capacity);
346 this->_S_copy(__tmp, _M_data(), length() + 1);
352 template<
typename _CharT,
typename _Traits,
typename _Alloc>
359 const size_type __how_much = length() - __pos - __len1;
361 size_type __new_capacity = length() + __len2 - __len1;
362 pointer __r = _M_create(__new_capacity, capacity());
365 this->_S_copy(__r, _M_data(), __pos);
367 this->_S_copy(__r + __pos, __s, __len2);
369 this->_S_copy(__r + __pos + __len2,
370 _M_data() + __pos + __len1, __how_much);
374 _M_capacity(__new_capacity);
377 template<
typename _CharT,
typename _Traits,
typename _Alloc>
383 const size_type __how_much = length() - __pos - __n;
385 if (__how_much && __n)
386 this->_S_move(_M_data() + __pos, _M_data() + __pos + __n, __how_much);
388 _M_set_length(length() - __n);
391 template<
typename _CharT,
typename _Traits,
typename _Alloc>
401 const size_type __capacity = _M_allocated_capacity;
403 if (__length <=
size_type(_S_local_capacity))
406 this->_S_copy(_M_local_buf, _M_data(), __length + 1);
407 _M_destroy(__capacity);
408 _M_data(_M_local_data());
411 else if (__length < __capacity)
414 pointer __tmp = _S_allocate(_M_get_allocator(), __length + 1);
415 this->_S_copy(__tmp, _M_data(), __length + 1);
418 _M_capacity(__length);
420 catch (
const __cxxabiv1::__forced_unwind&)
427 template<
typename _CharT,
typename _Traits,
typename _Alloc>
435 this->append(__n - __size, __c);
436 else if (__n < __size)
437 this->_M_set_length(__n);
440 template<
typename _CharT,
typename _Traits,
typename _Alloc>
448 if (__len <= this->capacity())
451 this->_S_copy(this->_M_data() + this->
size(), __s, __n);
456 this->_M_set_length(__len);
460 template<
typename _CharT,
typename _Traits,
typename _Alloc>
461 template<
typename _InputIterator>
466 _InputIterator __k1, _InputIterator __k2,
471 const basic_string __s(__k1, __k2, this->get_allocator());
473 return _M_replace(__i1 -
begin(), __n1, __s._M_data(),
477 template<
typename _CharT,
typename _Traits,
typename _Alloc>
484 _M_check_length(__n1, __n2,
"basic_string::_M_replace_aux");
487 const size_type __new_size = __old_size + __n2 - __n1;
489 if (__new_size <= this->capacity())
491 pointer __p = this->_M_data() + __pos1;
493 const size_type __how_much = __old_size - __pos1 - __n1;
494 if (__how_much && __n1 != __n2)
495 this->_S_move(__p + __n2, __p + __n1, __how_much);
498 this->_M_mutate(__pos1, __n1, 0, __n2);
501 this->_S_assign(this->_M_data() + __pos1, __n2, __c);
503 this->_M_set_length(__new_size);
507 template<
typename _CharT,
typename _Traits,
typename _Alloc>
508 __attribute__((__noinline__, __noclone__, __cold__))
void
514 if (__len2 && __len2 <= __len1)
515 this->_S_move(__p, __s, __len2);
516 if (__how_much && __len1 != __len2)
517 this->_S_move(__p + __len2, __p + __len1, __how_much);
520 if (__s + __len2 <= __p + __len1)
521 this->_S_move(__p, __s, __len2);
522 else if (__s >= __p + __len1)
526 const size_type __poff = (__s - __p) + (__len2 - __len1);
527 this->_S_copy(__p, __p + __poff, __len2);
531 const size_type __nleft = (__p + __len1) - __s;
532 this->_S_move(__p, __s, __nleft);
533 this->_S_copy(__p + __nleft, __p + __len2, __len2 - __nleft);
538 template<
typename _CharT,
typename _Traits,
typename _Alloc>
545 _M_check_length(__len1, __len2,
"basic_string::_M_replace");
548 const size_type __new_size = __old_size + __len2 - __len1;
550 if (__new_size <= this->capacity())
552 pointer __p = this->_M_data() + __pos;
554 const size_type __how_much = __old_size - __pos - __len1;
555#if __cpp_lib_is_constant_evaluated
556 if (std::is_constant_evaluated())
558 auto __newp = _S_allocate(_M_get_allocator(), __new_size);
559 _S_copy(__newp, this->_M_data(), __pos);
560 _S_copy(__newp + __pos, __s, __len2);
561 _S_copy(__newp + __pos + __len2, __p + __len1, __how_much);
562 _S_copy(this->_M_data(), __newp, __new_size);
563 this->_M_get_allocator().deallocate(__newp, __new_size);
567 if (__builtin_expect(_M_disjunct(__s),
true))
569 if (__how_much && __len1 != __len2)
570 this->_S_move(__p + __len2, __p + __len1, __how_much);
572 this->_S_copy(__p, __s, __len2);
575 _M_replace_cold(__p, __len1, __s, __len2, __how_much);
578 this->_M_mutate(__pos, __len1, __s, __len2);
580 this->_M_set_length(__new_size);
584 template<
typename _CharT,
typename _Traits,
typename _Alloc>
586 typename basic_string<_CharT, _Traits, _Alloc>::size_type
590 _M_check(__pos,
"basic_string::copy");
591 __n = _M_limit(__pos, __n);
592 __glibcxx_requires_string_len(__s, __n);
594 _S_copy(__s, _M_data() + __pos, __n);
599#ifdef __glibcxx_string_resize_and_overwrite
600 template<
typename _CharT,
typename _Traits,
typename _Alloc>
601 template<
typename _Operation>
602 [[__gnu__::__always_inline__]]
606 { resize_and_overwrite<_Operation&>(__n, __op); }
609#if __cplusplus >= 201103L
610 template<
typename _CharT,
typename _Traits,
typename _Alloc>
611 template<
typename _Operation>
612 _GLIBCXX20_CONSTEXPR
void
614#ifdef __glibcxx_string_resize_and_overwrite
615 resize_and_overwrite(
const size_type __n, _Operation __op)
617 __resize_and_overwrite(
const size_type __n, _Operation __op)
621 _CharT*
const __p = _M_data();
622#if __cpp_lib_is_constant_evaluated
623 if (std::__is_constant_evaluated() && __n >
size())
624 traits_type::assign(__p +
size(), __n -
size(), _CharT());
627 _GLIBCXX20_CONSTEXPR ~_Terminator() { _M_this->_M_set_length(_M_r); }
628 basic_string* _M_this;
631 _Terminator __term{
this, 0};
632 auto __r =
std::move(__op)(__p + 0, __n + 0);
633#ifdef __cpp_lib_concepts
634 static_assert(ranges::__detail::__is_integer_like<
decltype(__r)>);
636 static_assert(__gnu_cxx::__is_integer_nonstrict<
decltype(__r)>::__value,
637 "resize_and_overwrite operation must return an integer");
639 _GLIBCXX_DEBUG_ASSERT(__r >= 0 &&
size_type(__r) <= __n);
641 if (__term._M_r > __n)
642 __builtin_unreachable();
648#if __glibcxx_constexpr_string >= 201907L
649# define _GLIBCXX_STRING_CONSTEXPR constexpr
651# define _GLIBCXX_STRING_CONSTEXPR
653 template<
typename _CharT,
typename _Traits,
typename _Alloc>
654 _GLIBCXX_STRING_CONSTEXPR
655 typename basic_string<_CharT, _Traits, _Alloc>::size_type
657 find(
const _CharT* __s, size_type __pos, size_type __n)
const
660 __glibcxx_requires_string_len(__s, __n);
661 const size_type __size = this->
size();
664 return __pos <= __size ? __pos :
npos;
668 const _CharT __elem0 = __s[0];
669 const _CharT*
const __data =
data();
670 const _CharT* __first = __data + __pos;
671 const _CharT*
const __last = __data + __size;
672 size_type __len = __size - __pos;
677 __first = traits_type::find(__first, __len - __n + 1, __elem0);
683 if (traits_type::compare(__first, __s, __n) == 0)
684 return __first - __data;
685 __len = __last - ++__first;
690 template<
typename _CharT,
typename _Traits,
typename _Alloc>
691 _GLIBCXX_STRING_CONSTEXPR
692 typename basic_string<_CharT, _Traits, _Alloc>::size_type
694 find(_CharT __c, size_type __pos)
const _GLIBCXX_NOEXCEPT
696 size_type __ret =
npos;
697 const size_type __size = this->
size();
700 const _CharT* __data = _M_data();
701 const size_type __n = __size - __pos;
702 const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
704 __ret = __p - __data;
709 template<
typename _CharT,
typename _Traits,
typename _Alloc>
710 _GLIBCXX_STRING_CONSTEXPR
711 typename basic_string<_CharT, _Traits, _Alloc>::size_type
713 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const
716 __glibcxx_requires_string_len(__s, __n);
717 const size_type __size = this->
size();
720 __pos =
std::min(size_type(__size - __n), __pos);
721 const _CharT* __data = _M_data();
724 if (traits_type::compare(__data + __pos, __s, __n) == 0)
732 template<
typename _CharT,
typename _Traits,
typename _Alloc>
733 _GLIBCXX_STRING_CONSTEXPR
734 typename basic_string<_CharT, _Traits, _Alloc>::size_type
736 rfind(_CharT __c, size_type __pos)
const _GLIBCXX_NOEXCEPT
738 size_type __size = this->
size();
741 if (--__size > __pos)
743 for (++__size; __size-- > 0; )
744 if (traits_type::eq(_M_data()[__size], __c))
750 template<
typename _CharT,
typename _Traits,
typename _Alloc>
751 _GLIBCXX_STRING_CONSTEXPR
752 typename basic_string<_CharT, _Traits, _Alloc>::size_type
754 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const
757 __glibcxx_requires_string_len(__s, __n);
758 for (; __n && __pos < this->
size(); ++__pos)
760 const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
767 template<
typename _CharT,
typename _Traits,
typename _Alloc>
768 _GLIBCXX_STRING_CONSTEXPR
769 typename basic_string<_CharT, _Traits, _Alloc>::size_type
771 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const
774 __glibcxx_requires_string_len(__s, __n);
775 size_type __size = this->
size();
778 if (--__size > __pos)
782 if (traits_type::find(__s, __n, _M_data()[__size]))
785 while (__size-- != 0);
790 template<
typename _CharT,
typename _Traits,
typename _Alloc>
791 _GLIBCXX_STRING_CONSTEXPR
792 typename basic_string<_CharT, _Traits, _Alloc>::size_type
797 __glibcxx_requires_string_len(__s, __n);
798 for (; __pos < this->
size(); ++__pos)
799 if (!traits_type::find(__s, __n, _M_data()[__pos]))
804 template<
typename _CharT,
typename _Traits,
typename _Alloc>
805 _GLIBCXX_STRING_CONSTEXPR
806 typename basic_string<_CharT, _Traits, _Alloc>::size_type
810 for (; __pos < this->
size(); ++__pos)
811 if (!traits_type::eq(_M_data()[__pos], __c))
816 template<
typename _CharT,
typename _Traits,
typename _Alloc>
817 _GLIBCXX_STRING_CONSTEXPR
818 typename basic_string<_CharT, _Traits, _Alloc>::size_type
823 __glibcxx_requires_string_len(__s, __n);
824 size_type __size = this->
size();
827 if (--__size > __pos)
831 if (!traits_type::find(__s, __n, _M_data()[__size]))
839 template<
typename _CharT,
typename _Traits,
typename _Alloc>
840 _GLIBCXX_STRING_CONSTEXPR
841 typename basic_string<_CharT, _Traits, _Alloc>::size_type
845 size_type __size = this->
size();
848 if (--__size > __pos)
852 if (!traits_type::eq(_M_data()[__size], __c))
860#undef _GLIBCXX_STRING_CONSTEXPR
863 template<
typename _CharT,
typename _Traits,
typename _Alloc>
870 typedef typename __istream_type::ios_base __ios_base;
871 typedef typename __istream_type::int_type __int_type;
872 typedef typename __string_type::size_type __size_type;
874 typedef typename __ctype_type::ctype_base __ctype_base;
876 __size_type __extracted = 0;
877 typename __ios_base::iostate __err = __ios_base::goodbit;
878 typename __istream_type::sentry __cerb(__in,
false);
886 __size_type __len = 0;
888 const __size_type __n = __w > 0 ?
static_cast<__size_type
>(__w)
891 const __int_type __eof = _Traits::eof();
892 __int_type __c = __in.
rdbuf()->sgetc();
894 while (__extracted < __n
895 && !_Traits::eq_int_type(__c, __eof)
896 && !__ct.is(__ctype_base::space,
897 _Traits::to_char_type(__c)))
899 if (__len ==
sizeof(__buf) /
sizeof(_CharT))
901 __str.
append(__buf,
sizeof(__buf) /
sizeof(_CharT));
904 __buf[__len++] = _Traits::to_char_type(__c);
906 __c = __in.
rdbuf()->snextc();
908 __str.
append(__buf, __len);
910 if (__extracted < __n && _Traits::eq_int_type(__c, __eof))
911 __err |= __ios_base::eofbit;
916 __in._M_setstate(__ios_base::badbit);
917 __throw_exception_again;
924 __in._M_setstate(__ios_base::badbit);
929 __err |= __ios_base::failbit;
935 template<
typename _CharT,
typename _Traits,
typename _Alloc>
936 basic_istream<_CharT, _Traits>&
942 typedef typename __istream_type::ios_base __ios_base;
943 typedef typename __istream_type::int_type __int_type;
944 typedef typename __string_type::size_type __size_type;
946 __size_type __extracted = 0;
947 const __size_type __n = __str.
max_size();
948 typename __ios_base::iostate __err = __ios_base::goodbit;
949 typename __istream_type::sentry __cerb(__in,
true);
955 const __int_type __idelim = _Traits::to_int_type(__delim);
956 const __int_type __eof = _Traits::eof();
957 __int_type __c = __in.
rdbuf()->sgetc();
959 while (__extracted < __n
960 && !_Traits::eq_int_type(__c, __eof)
961 && !_Traits::eq_int_type(__c, __idelim))
963 __str += _Traits::to_char_type(__c);
965 __c = __in.
rdbuf()->snextc();
968 if (_Traits::eq_int_type(__c, __eof))
969 __err |= __ios_base::eofbit;
970 else if (_Traits::eq_int_type(__c, __idelim))
973 __in.
rdbuf()->sbumpc();
976 __err |= __ios_base::failbit;
980 __in._M_setstate(__ios_base::badbit);
981 __throw_exception_again;
988 __in._M_setstate(__ios_base::badbit);
992 __err |= __ios_base::failbit;
1000#if _GLIBCXX_EXTERN_TEMPLATE
1006# if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0
1007 extern template class basic_string<char>;
1008# elif ! _GLIBCXX_USE_CXX11_ABI
1011 extern template basic_string<char>::size_type
1012 basic_string<char>::_Rep::_S_empty_rep_storage[];
1013# elif _GLIBCXX_EXTERN_TEMPLATE > 0
1015 extern template void
1016 basic_string<char>::_M_replace_cold(
char *, size_type,
const char*,
1017 const size_type,
const size_type);
1021 basic_istream<char>&
1024 basic_ostream<char>&
1025 operator<<(basic_ostream<char>&,
const string&);
1027 basic_istream<char>&
1028 getline(basic_istream<char>&,
string&,
char);
1030 basic_istream<char>&
1031 getline(basic_istream<char>&,
string&);
1033#ifdef _GLIBCXX_USE_WCHAR_T
1034# if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0
1035 extern template class basic_string<wchar_t>;
1036# elif ! _GLIBCXX_USE_CXX11_ABI
1037 extern template basic_string<wchar_t>::size_type
1038 basic_string<wchar_t>::_Rep::_S_empty_rep_storage[];
1039# elif _GLIBCXX_EXTERN_TEMPLATE > 0
1041 extern template void
1042 basic_string<wchar_t>::_M_replace_cold(
wchar_t*, size_type,
const wchar_t*,
1043 const size_type,
const size_type);
1047 basic_istream<wchar_t>&
1050 basic_ostream<wchar_t>&
1053 basic_istream<wchar_t>&
1056 basic_istream<wchar_t>&
1061_GLIBCXX_END_NAMESPACE_VERSION
1064#pragma GCC diagnostic pop
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
_Tp * begin(valarray< _Tp > &__va) noexcept
Return an iterator pointing to the first element of the valarray.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
const _Facet & use_facet(const locale &__loc)
Return a facet.
basic_string< wchar_t > wstring
A string of wchar_t.
ISO C++ entities toplevel namespace is std.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
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.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
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.
constexpr auto data(_Container &__cont) noexcept(noexcept(__cont.data())) -> decltype(__cont.data())
Return the data pointer of a container.
void setstate(iostate __state)
Sets additional flags in the error state.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
Template class basic_istream.
Managing sequences of characters and character-like objects.
constexpr 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.
constexpr size_type find(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find position of a C substring.
constexpr size_type copy(_CharT *__s, size_type __n, size_type __pos=0) const
Copy substring into C string.
constexpr size_type find_first_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character of string.
constexpr void resize(size_type __n, _CharT __c)
Resizes the string to the specified number of characters.
constexpr void __resize_and_overwrite(size_type __n, _Operation __op)
Non-standard version of resize_and_overwrite for C++11 and above.
constexpr size_type rfind(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a string.
constexpr basic_string & append(const basic_string &__str)
Append a string to this string.
constexpr size_type find_last_of(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a character of string.
constexpr size_type find_first_not_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character not in string.
static const size_type npos
Value returned by various member functions when they fail.
constexpr basic_string & erase(size_type __pos=0, size_type __n=npos)
Remove characters.
constexpr size_type max_size() const noexcept
Returns the size() of the largest possible string.
constexpr void swap(basic_string &__s) noexcept
Swap contents with another string.
Thrown as part of forced unwinding.
streamsize width() const
Flags access.
locale getloc() const
Locale access.
Primary class template ctype facet.