39#ifndef _BASIC_STRING_TCC
40#define _BASIC_STRING_TCC 1
42#pragma GCC system_header
46namespace std _GLIBCXX_VISIBILITY(default)
48_GLIBCXX_BEGIN_NAMESPACE_VERSION
50#if _GLIBCXX_USE_CXX11_ABI
52 template<
typename _CharT,
typename _Traits,
typename _Alloc>
53 const typename basic_string<_CharT, _Traits, _Alloc>::size_type
56 template<
typename _CharT,
typename _Traits,
typename _Alloc>
60 swap(basic_string& __s) _GLIBCXX_NOEXCEPT
65 _Alloc_traits::_S_on_swap(_M_get_allocator(), __s._M_get_allocator());
68 if (__s._M_is_local())
70 if (length() && __s.length())
72 _CharT __tmp_data[_S_local_capacity + 1];
73 traits_type::copy(__tmp_data, __s._M_local_buf,
75 traits_type::copy(__s._M_local_buf, _M_local_buf,
77 traits_type::copy(_M_local_buf, __tmp_data,
80 else if (__s.length())
82 traits_type::copy(_M_local_buf, __s._M_local_buf,
84 _M_length(__s.length());
90 traits_type::copy(__s._M_local_buf, _M_local_buf,
92 __s._M_length(length());
99 const size_type __tmp_capacity = __s._M_allocated_capacity;
100 traits_type::copy(__s._M_local_buf, _M_local_buf,
102 _M_data(__s._M_data());
103 __s._M_data(__s._M_local_buf);
104 _M_capacity(__tmp_capacity);
108 const size_type __tmp_capacity = _M_allocated_capacity;
109 if (__s._M_is_local())
111 traits_type::copy(_M_local_buf, __s._M_local_buf,
113 __s._M_data(_M_data());
114 _M_data(_M_local_buf);
118 pointer __tmp_ptr = _M_data();
119 _M_data(__s._M_data());
120 __s._M_data(__tmp_ptr);
121 _M_capacity(__s._M_allocated_capacity);
123 __s._M_capacity(__tmp_capacity);
126 const size_type __tmp_length = length();
127 _M_length(__s.length());
128 __s._M_length(__tmp_length);
131 template<
typename _CharT,
typename _Traits,
typename _Alloc>
133 typename basic_string<_CharT, _Traits, _Alloc>::pointer
134 basic_string<_CharT, _Traits, _Alloc>::
135 _M_create(size_type& __capacity, size_type __old_capacity)
139 if (__capacity > max_size())
140 std::__throw_length_error(__N(
"basic_string::_M_create"));
145 if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
147 __capacity = 2 * __old_capacity;
149 if (__capacity > max_size())
150 __capacity = max_size();
155 return _Alloc_traits::allocate(_M_get_allocator(), __capacity + 1);
162 template<
typename _CharT,
typename _Traits,
typename _Alloc>
163 template<
typename _InIterator>
166 basic_string<_CharT, _Traits, _Alloc>::
167 _M_construct(_InIterator __beg, _InIterator __end,
171 size_type __capacity = size_type(_S_local_capacity);
173 pointer __p = _M_use_local_data();
175 while (__beg != __end && __len < __capacity)
177 __p[__len++] = *__beg;
184 explicit _Guard(basic_string* __s) : _M_guarded(__s) { }
187 ~_Guard() {
if (_M_guarded) _M_guarded->_M_dispose(); }
189 basic_string* _M_guarded;
192 while (__beg != __end)
194 if (__len == __capacity)
197 __capacity = __len + 1;
198 pointer __another = _M_create(__capacity, __len);
199 this->_S_copy(__another, _M_data(), __len);
202 _M_capacity(__capacity);
204 traits_type::assign(_M_data()[__len++], *__beg);
208 __guard._M_guarded = 0;
210 _M_set_length(__len);
213 template<
typename _CharT,
typename _Traits,
typename _Alloc>
214 template<
typename _InIterator>
217 basic_string<_CharT, _Traits, _Alloc>::
218 _M_construct(_InIterator __beg, _InIterator __end,
221 size_type __dnew =
static_cast<size_type
>(
std::distance(__beg, __end));
223 if (__dnew > size_type(_S_local_capacity))
225 _M_data(_M_create(__dnew, size_type(0)));
235 explicit _Guard(basic_string* __s) : _M_guarded(__s) { }
238 ~_Guard() {
if (_M_guarded) _M_guarded->_M_dispose(); }
240 basic_string* _M_guarded;
243 this->_S_copy_chars(_M_data(), __beg, __end);
245 __guard._M_guarded = 0;
247 _M_set_length(__dnew);
250 template<
typename _CharT,
typename _Traits,
typename _Alloc>
253 basic_string<_CharT, _Traits, _Alloc>::
254 _M_construct(size_type __n, _CharT __c)
256 if (__n > size_type(_S_local_capacity))
258 _M_data(_M_create(__n, size_type(0)));
265 this->_S_assign(_M_data(), __n, __c);
270 template<
typename _CharT,
typename _Traits,
typename _Alloc>
273 basic_string<_CharT, _Traits, _Alloc>::
274 _M_assign(
const basic_string& __str)
278 const size_type __rsize = __str.length();
279 const size_type __capacity = capacity();
281 if (__rsize > __capacity)
283 size_type __new_capacity = __rsize;
284 pointer __tmp = _M_create(__new_capacity, __capacity);
287 _M_capacity(__new_capacity);
291 this->_S_copy(_M_data(), __str._M_data(), __rsize);
293 _M_set_length(__rsize);
297 template<
typename _CharT,
typename _Traits,
typename _Alloc>
303 const size_type __capacity = capacity();
308 if (__res <= __capacity)
311 pointer __tmp = _M_create(__res, __capacity);
312 this->_S_copy(__tmp, _M_data(), length() + 1);
318 template<
typename _CharT,
typename _Traits,
typename _Alloc>
321 basic_string<_CharT, _Traits, _Alloc>::
322 _M_mutate(size_type __pos, size_type __len1,
const _CharT* __s,
325 const size_type __how_much = length() - __pos - __len1;
327 size_type __new_capacity = length() + __len2 - __len1;
328 pointer __r = _M_create(__new_capacity, capacity());
331 this->_S_copy(__r, _M_data(), __pos);
333 this->_S_copy(__r + __pos, __s, __len2);
335 this->_S_copy(__r + __pos + __len2,
336 _M_data() + __pos + __len1, __how_much);
340 _M_capacity(__new_capacity);
343 template<
typename _CharT,
typename _Traits,
typename _Alloc>
346 basic_string<_CharT, _Traits, _Alloc>::
347 _M_erase(size_type __pos, size_type __n)
349 const size_type __how_much = length() - __pos - __n;
351 if (__how_much && __n)
352 this->_S_move(_M_data() + __pos, _M_data() + __pos + __n, __how_much);
354 _M_set_length(length() - __n);
357 template<
typename _CharT,
typename _Traits,
typename _Alloc>
366 const size_type __length = length();
367 const size_type __capacity = _M_allocated_capacity;
369 if (__length <= size_type(_S_local_capacity))
371 this->_S_copy(_M_use_local_data(), _M_data(), __length + 1);
372 _M_destroy(__capacity);
373 _M_data(_M_local_data());
376 else if (__length < __capacity)
380 = _Alloc_traits::allocate(_M_get_allocator(), __length + 1);
381 this->_S_copy(__tmp, _M_data(), __length + 1);
384 _M_capacity(__length);
393 template<
typename _CharT,
typename _Traits,
typename _Alloc>
397 resize(size_type __n, _CharT __c)
399 const size_type __size = this->
size();
401 this->append(__n - __size, __c);
402 else if (__n < __size)
403 this->_M_set_length(__n);
406 template<
typename _CharT,
typename _Traits,
typename _Alloc>
408 basic_string<_CharT, _Traits, _Alloc>&
409 basic_string<_CharT, _Traits, _Alloc>::
410 _M_append(
const _CharT* __s, size_type __n)
412 const size_type __len = __n + this->
size();
414 if (__len <= this->capacity())
417 this->_S_copy(this->_M_data() + this->
size(), __s, __n);
420 this->_M_mutate(this->
size(), size_type(0), __s, __n);
422 this->_M_set_length(__len);
426 template<
typename _CharT,
typename _Traits,
typename _Alloc>
427 template<
typename _InputIterator>
429 basic_string<_CharT, _Traits, _Alloc>&
430 basic_string<_CharT, _Traits, _Alloc>::
431 _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
432 _InputIterator __k1, _InputIterator __k2,
437 const basic_string __s(__k1, __k2, this->get_allocator());
438 const size_type __n1 = __i2 - __i1;
439 return _M_replace(__i1 -
begin(), __n1, __s._M_data(),
443 template<
typename _CharT,
typename _Traits,
typename _Alloc>
445 basic_string<_CharT, _Traits, _Alloc>&
446 basic_string<_CharT, _Traits, _Alloc>::
447 _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
450 _M_check_length(__n1, __n2,
"basic_string::_M_replace_aux");
452 const size_type __old_size = this->
size();
453 const size_type __new_size = __old_size + __n2 - __n1;
455 if (__new_size <= this->capacity())
457 pointer __p = this->_M_data() + __pos1;
459 const size_type __how_much = __old_size - __pos1 - __n1;
460 if (__how_much && __n1 != __n2)
461 this->_S_move(__p + __n2, __p + __n1, __how_much);
464 this->_M_mutate(__pos1, __n1, 0, __n2);
467 this->_S_assign(this->_M_data() + __pos1, __n2, __c);
469 this->_M_set_length(__new_size);
473 template<
typename _CharT,
typename _Traits,
typename _Alloc>
474 __attribute__((__noinline__, __noclone__, __cold__))
void
475 basic_string<_CharT, _Traits, _Alloc>::
476 _M_replace_cold(pointer __p, size_type __len1,
const _CharT* __s,
477 const size_type __len2,
const size_type __how_much)
480 if (__len2 && __len2 <= __len1)
481 this->_S_move(__p, __s, __len2);
482 if (__how_much && __len1 != __len2)
483 this->_S_move(__p + __len2, __p + __len1, __how_much);
486 if (__s + __len2 <= __p + __len1)
487 this->_S_move(__p, __s, __len2);
488 else if (__s >= __p + __len1)
492 const size_type __poff = (__s - __p) + (__len2 - __len1);
493 this->_S_copy(__p, __p + __poff, __len2);
497 const size_type __nleft = (__p + __len1) - __s;
498 this->_S_move(__p, __s, __nleft);
499 this->_S_copy(__p + __nleft, __p + __len2, __len2 - __nleft);
504 template<
typename _CharT,
typename _Traits,
typename _Alloc>
506 basic_string<_CharT, _Traits, _Alloc>&
507 basic_string<_CharT, _Traits, _Alloc>::
508 _M_replace(size_type __pos, size_type __len1,
const _CharT* __s,
509 const size_type __len2)
511 _M_check_length(__len1, __len2,
"basic_string::_M_replace");
513 const size_type __old_size = this->
size();
514 const size_type __new_size = __old_size + __len2 - __len1;
516 if (__new_size <= this->capacity())
518 pointer __p = this->_M_data() + __pos;
520 const size_type __how_much = __old_size - __pos - __len1;
521#if __cpp_lib_is_constant_evaluated
524 auto __newp = _Alloc_traits::allocate(_M_get_allocator(),
526 _S_copy(__newp, this->_M_data(), __pos);
527 _S_copy(__newp + __pos, __s, __len2);
528 _S_copy(__newp + __pos + __len2, __p + __len1, __how_much);
529 _S_copy(this->_M_data(), __newp, __new_size);
530 this->_M_get_allocator().deallocate(__newp, __new_size);
534 if (__builtin_expect(_M_disjunct(__s),
true))
536 if (__how_much && __len1 != __len2)
537 this->_S_move(__p + __len2, __p + __len1, __how_much);
539 this->_S_copy(__p, __s, __len2);
542 _M_replace_cold(__p, __len1, __s, __len2, __how_much);
545 this->_M_mutate(__pos, __len1, __s, __len2);
547 this->_M_set_length(__new_size);
551 template<
typename _CharT,
typename _Traits,
typename _Alloc>
553 typename basic_string<_CharT, _Traits, _Alloc>::size_type
555 copy(_CharT* __s, size_type __n, size_type __pos)
const
557 _M_check(__pos,
"basic_string::copy");
558 __n = _M_limit(__pos, __n);
559 __glibcxx_requires_string_len(__s, __n);
561 _S_copy(__s, _M_data() + __pos, __n);
566#if __cplusplus > 202002L
567 template<
typename _CharT,
typename _Traits,
typename _Alloc>
568 template<
typename _Operation>
570 basic_string<_CharT, _Traits, _Alloc>::
571 resize_and_overwrite(size_type __n, _Operation __op)
573 const size_type __capacity = capacity();
575 if (__n > __capacity)
577 __p = _M_create(__n, __capacity);
578 this->_S_copy(__p, _M_data(), length());
579#if __cpp_lib_is_constant_evaluated
581 traits_type::assign(__p + length(), __n - length(), _CharT());
590 constexpr ~_Terminator() { _M_this->_M_set_length(_M_r); }
591 basic_string* _M_this;
594 _Terminator __term{
this};
595 auto __r =
std::move(__op)(
auto(__p),
auto(__n));
596 static_assert(ranges::__detail::__is_integer_like<
decltype(__r)>);
597 _GLIBCXX_DEBUG_ASSERT(__r >= 0 && __r <= __n);
598 __term._M_r = size_type(__r);
599 if (__term._M_r > __n)
600 __builtin_unreachable();
606#if __cpp_lib_constexpr_string >= 201907L
607# define _GLIBCXX_STRING_CONSTEXPR constexpr
609# define _GLIBCXX_STRING_CONSTEXPR
611 template<
typename _CharT,
typename _Traits,
typename _Alloc>
612 _GLIBCXX_STRING_CONSTEXPR
613 typename basic_string<_CharT, _Traits, _Alloc>::size_type
615 find(
const _CharT* __s, size_type __pos, size_type __n)
const
618 __glibcxx_requires_string_len(__s, __n);
619 const size_type __size = this->
size();
622 return __pos <= __size ? __pos : npos;
626 const _CharT __elem0 = __s[0];
627 const _CharT*
const __data =
data();
628 const _CharT* __first = __data + __pos;
629 const _CharT*
const __last = __data + __size;
630 size_type __len = __size - __pos;
635 __first = traits_type::find(__first, __len - __n + 1, __elem0);
641 if (traits_type::compare(__first, __s, __n) == 0)
642 return __first - __data;
643 __len = __last - ++__first;
648 template<
typename _CharT,
typename _Traits,
typename _Alloc>
649 _GLIBCXX_STRING_CONSTEXPR
650 typename basic_string<_CharT, _Traits, _Alloc>::size_type
652 find(_CharT __c, size_type __pos)
const _GLIBCXX_NOEXCEPT
654 size_type __ret = npos;
655 const size_type __size = this->
size();
658 const _CharT* __data = _M_data();
659 const size_type __n = __size - __pos;
660 const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
662 __ret = __p - __data;
667 template<
typename _CharT,
typename _Traits,
typename _Alloc>
668 _GLIBCXX_STRING_CONSTEXPR
669 typename basic_string<_CharT, _Traits, _Alloc>::size_type
671 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const
674 __glibcxx_requires_string_len(__s, __n);
675 const size_type __size = this->
size();
678 __pos =
std::min(size_type(__size - __n), __pos);
679 const _CharT* __data = _M_data();
682 if (traits_type::compare(__data + __pos, __s, __n) == 0)
690 template<
typename _CharT,
typename _Traits,
typename _Alloc>
691 _GLIBCXX_STRING_CONSTEXPR
692 typename basic_string<_CharT, _Traits, _Alloc>::size_type
694 rfind(_CharT __c, size_type __pos)
const _GLIBCXX_NOEXCEPT
696 size_type __size = this->
size();
699 if (--__size > __pos)
701 for (++__size; __size-- > 0; )
702 if (traits_type::eq(_M_data()[__size], __c))
708 template<
typename _CharT,
typename _Traits,
typename _Alloc>
709 _GLIBCXX_STRING_CONSTEXPR
710 typename basic_string<_CharT, _Traits, _Alloc>::size_type
712 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const
715 __glibcxx_requires_string_len(__s, __n);
716 for (; __n && __pos < this->
size(); ++__pos)
718 const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
725 template<
typename _CharT,
typename _Traits,
typename _Alloc>
726 _GLIBCXX_STRING_CONSTEXPR
727 typename basic_string<_CharT, _Traits, _Alloc>::size_type
729 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const
732 __glibcxx_requires_string_len(__s, __n);
733 size_type __size = this->
size();
736 if (--__size > __pos)
740 if (traits_type::find(__s, __n, _M_data()[__size]))
743 while (__size-- != 0);
748 template<
typename _CharT,
typename _Traits,
typename _Alloc>
749 _GLIBCXX_STRING_CONSTEXPR
750 typename basic_string<_CharT, _Traits, _Alloc>::size_type
755 __glibcxx_requires_string_len(__s, __n);
756 for (; __pos < this->
size(); ++__pos)
757 if (!traits_type::find(__s, __n, _M_data()[__pos]))
762 template<
typename _CharT,
typename _Traits,
typename _Alloc>
763 _GLIBCXX_STRING_CONSTEXPR
764 typename basic_string<_CharT, _Traits, _Alloc>::size_type
768 for (; __pos < this->
size(); ++__pos)
769 if (!traits_type::eq(_M_data()[__pos], __c))
774 template<
typename _CharT,
typename _Traits,
typename _Alloc>
775 _GLIBCXX_STRING_CONSTEXPR
776 typename basic_string<_CharT, _Traits, _Alloc>::size_type
781 __glibcxx_requires_string_len(__s, __n);
782 size_type __size = this->
size();
785 if (--__size > __pos)
789 if (!traits_type::find(__s, __n, _M_data()[__size]))
797 template<
typename _CharT,
typename _Traits,
typename _Alloc>
798 _GLIBCXX_STRING_CONSTEXPR
799 typename basic_string<_CharT, _Traits, _Alloc>::size_type
803 size_type __size = this->
size();
806 if (--__size > __pos)
810 if (!traits_type::eq(_M_data()[__size], __c))
818#undef _GLIBCXX_STRING_CONSTEXPR
821 template<
typename _CharT,
typename _Traits,
typename _Alloc>
828 typedef typename __istream_type::ios_base __ios_base;
829 typedef typename __istream_type::int_type __int_type;
830 typedef typename __string_type::size_type __size_type;
832 typedef typename __ctype_type::ctype_base __ctype_base;
834 __size_type __extracted = 0;
835 typename __ios_base::iostate __err = __ios_base::goodbit;
836 typename __istream_type::sentry __cerb(__in,
false);
844 __size_type __len = 0;
846 const __size_type __n = __w > 0 ?
static_cast<__size_type
>(__w)
848 const __ctype_type& __ct = use_facet<__ctype_type>(__in.
getloc());
849 const __int_type __eof = _Traits::eof();
850 __int_type __c = __in.
rdbuf()->sgetc();
852 while (__extracted < __n
853 && !_Traits::eq_int_type(__c, __eof)
854 && !__ct.is(__ctype_base::space,
855 _Traits::to_char_type(__c)))
857 if (__len ==
sizeof(__buf) /
sizeof(_CharT))
859 __str.
append(__buf,
sizeof(__buf) /
sizeof(_CharT));
862 __buf[__len++] = _Traits::to_char_type(__c);
864 __c = __in.
rdbuf()->snextc();
866 __str.
append(__buf, __len);
868 if (__extracted < __n && _Traits::eq_int_type(__c, __eof))
869 __err |= __ios_base::eofbit;
874 __in._M_setstate(__ios_base::badbit);
875 __throw_exception_again;
882 __in._M_setstate(__ios_base::badbit);
887 __err |= __ios_base::failbit;
893 template<
typename _CharT,
typename _Traits,
typename _Alloc>
894 basic_istream<_CharT, _Traits>&
900 typedef typename __istream_type::ios_base __ios_base;
901 typedef typename __istream_type::int_type __int_type;
902 typedef typename __string_type::size_type __size_type;
904 __size_type __extracted = 0;
905 const __size_type __n = __str.
max_size();
906 typename __ios_base::iostate __err = __ios_base::goodbit;
907 typename __istream_type::sentry __cerb(__in,
true);
913 const __int_type __idelim = _Traits::to_int_type(__delim);
914 const __int_type __eof = _Traits::eof();
915 __int_type __c = __in.
rdbuf()->sgetc();
917 while (__extracted < __n
918 && !_Traits::eq_int_type(__c, __eof)
919 && !_Traits::eq_int_type(__c, __idelim))
921 __str += _Traits::to_char_type(__c);
923 __c = __in.
rdbuf()->snextc();
926 if (_Traits::eq_int_type(__c, __eof))
927 __err |= __ios_base::eofbit;
928 else if (_Traits::eq_int_type(__c, __idelim))
931 __in.
rdbuf()->sbumpc();
934 __err |= __ios_base::failbit;
938 __in._M_setstate(__ios_base::badbit);
939 __throw_exception_again;
946 __in._M_setstate(__ios_base::badbit);
950 __err |= __ios_base::failbit;
958#if _GLIBCXX_EXTERN_TEMPLATE
964# if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0
965 extern template class basic_string<char>;
966# elif ! _GLIBCXX_USE_CXX11_ABI
969 extern template basic_string<char>::size_type
970 basic_string<char>::_Rep::_S_empty_rep_storage[];
971# elif _GLIBCXX_EXTERN_TEMPLATE > 0
974 basic_string<char>::_M_replace_cold(
char *, size_type,
const char*,
975 const size_type,
const size_type);
983 operator<<(basic_ostream<char>&,
const string&);
986 getline(basic_istream<char>&,
string&,
char);
989 getline(basic_istream<char>&,
string&);
991#ifdef _GLIBCXX_USE_WCHAR_T
992# if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0
993 extern template class basic_string<wchar_t>;
994# elif ! _GLIBCXX_USE_CXX11_ABI
995 extern template basic_string<wchar_t>::size_type
996 basic_string<wchar_t>::_Rep::_S_empty_rep_storage[];
997# elif _GLIBCXX_EXTERN_TEMPLATE > 0
1000 basic_string<wchar_t>::_M_replace_cold(
wchar_t*, size_type,
const wchar_t*,
1001 const size_type,
const size_type);
1005 basic_istream<wchar_t>&
1008 basic_ostream<wchar_t>&
1011 basic_istream<wchar_t>&
1014 basic_istream<wchar_t>&
1019_GLIBCXX_END_NAMESPACE_VERSION
constexpr bool is_constant_evaluated() noexcept
Returns true only when called during constant evaluation.
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.
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.
void swap(basic_string &__s) noexcept(/*conditional */)
Swap contents with another string.
size_type find_first_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character of string.
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.
size_type find_first_not_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character not in string.
size_type copy(_CharT *__s, size_type __n, size_type __pos=0) const
Copy substring into C string.
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 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().
basic_string & append(const basic_string &__str)
Append a string to this string.
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.
basic_string & erase(size_type __pos=0, size_type __n=npos)
Remove characters.
Thrown as part of forced unwinding.
streamsize width() const
Flags access.
locale getloc() const
Locale access.
Primary class template ctype facet.
Forward iterators support a superset of input iterator operations.