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>::_Alloc_result
148 if (__capacity > max_size())
149 std::__throw_length_error(__N(
"basic_string::_M_create_plus"));
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_at_least(_M_get_allocator(), __capacity + 1);
168 template<
typename _CharT,
typename _Traits,
typename _Alloc>
170 typename basic_string<_CharT, _Traits, _Alloc>::pointer
174 if (__capacity > max_size())
175 std::__throw_length_error(__N(
"basic_string::_M_create"));
176 if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
178 __capacity = 2 * __old_capacity;
179 if (__capacity > max_size())
180 __capacity = max_size();
182 return _S_allocate(_M_get_allocator(), __capacity + 1);
189 template<
typename _CharT,
typename _Traits,
typename _Alloc>
190 template<
typename _InIterator>
195 std::input_iterator_tag)
203 while (__beg != __end && __len < __capacity)
205 _M_local_buf[__len++] = *__beg;
212 explicit _Guard(basic_string* __s) : _M_guarded(__s) { }
215 ~_Guard() {
if (_M_guarded) _M_guarded->_M_dispose(); }
217 basic_string* _M_guarded;
220 while (__beg != __end)
222 if (__len == __capacity)
225 _Alloc_result __another = _M_create_plus(__len + 1, __len);
226 __capacity = __another.__count - 1;
227 this->_S_copy(__another.__ptr, _M_data(), __len);
229 _M_data(__another.__ptr);
230 _M_capacity(__capacity);
233#if __cplusplus >= 201103L
234# pragma GCC diagnostic push
235# pragma GCC diagnostic ignored "-Wc++17-extensions"
241 auto __r = std::__copy_n_a(__beg, __capacity - __len,
242 _M_data() + __len,
false);
243 __len = __r -
data();
249# pragma GCC diagnostic pop
251 traits_type::assign(_M_data()[__len++],
252 static_cast<_CharT
>(*__beg));
256 __guard._M_guarded = 0;
258 _M_set_length(__len);
261 template<
typename _CharT,
typename _Traits,
typename _Alloc>
262 template<
typename _InIterator>
267 std::forward_iterator_tag)
271 if (__dnew >
size_type(_S_local_capacity))
272 _M_create_and_place(__dnew,
size_type(0));
280 explicit _Guard(basic_string* __s) : _M_guarded(__s) { }
283 ~_Guard() {
if (_M_guarded) _M_guarded->_M_dispose(); }
285 basic_string* _M_guarded;
288 this->_S_copy_chars(_M_data(), __beg, __end);
290 __guard._M_guarded = 0;
292 _M_set_length(__dnew);
295 template<
typename _CharT,
typename _Traits,
typename _Alloc>
307 this->_S_assign(_M_data(), __n, __c);
314 template<
typename _CharT,
typename _Traits,
typename _Alloc>
315 template<
bool _Terminated>
326 if (__n || _Terminated)
327 this->_S_copy(_M_data(), __str, __n + _Terminated);
331 traits_type::assign(_M_data()[__n], _CharT());
334#if __cplusplus >= 202302L
335 template<
typename _CharT,
typename _Traits,
typename _Alloc>
340 const _CharT* __start = __str._M_data() + __pos;
341 if (__n <= _S_local_capacity)
344 traits_type::copy(_M_local_buf, __start, __n);
350 if (get_allocator() != __str.get_allocator())
352 _M_construct<false>(__start, __n);
356 _M_data(__str._M_data());
357 _M_capacity(__str._M_allocated_capacity);
358 __str._M_data(__str._M_use_local_data());
359 __str._M_set_length(0);
361 _S_move(_M_data(), _M_data() + __pos, __n);
366 template<
typename _CharT,
typename _Traits,
typename _Alloc>
374 const size_type __rsize = __str.length();
377 if (__rsize > __capacity)
380 _Alloc_result __tmp = _M_create_plus(__rsize, __capacity);
382 _M_data(__tmp.__ptr);
383 _M_capacity(__tmp.__count - 1);
387 this->_S_copy(_M_data(), __str._M_data(), __rsize);
389 _M_set_length(__rsize);
393 template<
typename _CharT,
typename _Traits,
typename _Alloc>
404 if (__res <= __capacity)
407 _Alloc_result __r = _M_create_plus(__res, __capacity);
408 this->_S_copy(__r.__ptr, _M_data(), length() + 1);
411 _M_capacity(__r.__count - 1);
414 template<
typename _CharT,
typename _Traits,
typename _Alloc>
421 const size_type __how_much = length() - __pos - __len1;
423 size_type __new_capacity = length() + __len2 - __len1;
424 _Alloc_result __r = _M_create_plus(__new_capacity, capacity());
427 this->_S_copy(__r.__ptr, _M_data(), __pos);
429 this->_S_copy(__r.__ptr + __pos, __s, __len2);
431 this->_S_copy(__r.__ptr + __pos + __len2,
432 _M_data() + __pos + __len1, __how_much);
436 _M_capacity(__r.__count - 1);
439 template<
typename _CharT,
typename _Traits,
typename _Alloc>
445 const size_type __how_much = length() - __pos - __n;
447 if (__how_much && __n)
448 this->_S_move(_M_data() + __pos, _M_data() + __pos + __n, __how_much);
450 _M_set_length(length() - __n);
453 template<
typename _CharT,
typename _Traits,
typename _Alloc>
463 const size_type __capacity = _M_allocated_capacity;
465 if (__length <=
size_type(_S_local_capacity))
468 this->_S_copy(_M_local_buf, _M_data(), __length + 1);
469 _M_destroy(__capacity);
470 _M_data(_M_local_data());
474#ifdef __glibcxx_allocate_at_least
476 (__STDCPP_DEFAULT_NEW_ALIGNMENT__ - 1) /
sizeof(_CharT);
480 if (__capacity - __length > __limit )
483 _Alloc_result __r = _S_allocate_at_least(
484 _M_get_allocator(), __length + 1);
485 this->_S_copy(__r.__ptr, _M_data(), __length + 1);
488 _M_capacity(__r.__count - 1);
490 catch (
const __cxxabiv1::__forced_unwind&)
497 template<
typename _CharT,
typename _Traits,
typename _Alloc>
505 this->append(__n - __size, __c);
506 else if (__n < __size)
507 this->_M_set_length(__n);
510 template<
typename _CharT,
typename _Traits,
typename _Alloc>
518 if (__len <= this->capacity())
521 this->_S_copy(this->_M_data() + this->
size(), __s, __n);
526 this->_M_set_length(__len);
530 template<
typename _CharT,
typename _Traits,
typename _Alloc>
531 template<
typename _InputIterator>
536 _InputIterator __k1, _InputIterator __k2,
541 const basic_string __s(__k1, __k2, this->get_allocator());
543 return _M_replace(__i1 -
begin(), __n1, __s._M_data(),
547 template<
typename _CharT,
typename _Traits,
typename _Alloc>
554 _M_check_length(__n1, __n2,
"basic_string::_M_replace_aux");
557 const size_type __new_size = __old_size + __n2 - __n1;
559 if (__new_size <= this->capacity())
561 pointer __p = this->_M_data() + __pos1;
563 const size_type __how_much = __old_size - __pos1 - __n1;
564 if (__how_much && __n1 != __n2)
565 this->_S_move(__p + __n2, __p + __n1, __how_much);
568 this->_M_mutate(__pos1, __n1, 0, __n2);
571 this->_S_assign(this->_M_data() + __pos1, __n2, __c);
573 this->_M_set_length(__new_size);
577 template<
typename _CharT,
typename _Traits,
typename _Alloc>
578 __attribute__((__noinline__, __noclone__, __cold__))
void
584 if (__len2 && __len2 <= __len1)
585 this->_S_move(__p, __s, __len2);
586 if (__how_much && __len1 != __len2)
587 this->_S_move(__p + __len2, __p + __len1, __how_much);
590 if (__s + __len2 <= __p + __len1)
591 this->_S_move(__p, __s, __len2);
592 else if (__s >= __p + __len1)
596 const size_type __poff = (__s - __p) + (__len2 - __len1);
597 this->_S_copy(__p, __p + __poff, __len2);
601 const size_type __nleft = (__p + __len1) - __s;
602 this->_S_move(__p, __s, __nleft);
603 this->_S_copy(__p + __nleft, __p + __len2, __len2 - __nleft);
608 template<
typename _CharT,
typename _Traits,
typename _Alloc>
615 _M_check_length(__len1, __len2,
"basic_string::_M_replace");
618 const size_type __new_size = __old_size + __len2 - __len1;
620 if (__new_size <= this->capacity())
622 pointer __p = this->_M_data() + __pos;
624 const size_type __how_much = __old_size - __pos - __len1;
625#if __cpp_lib_is_constant_evaluated
626 if (std::is_constant_evaluated())
629 _S_allocate_at_least(_M_get_allocator(), __new_size).__ptr;
630 _S_copy(__newp, this->_M_data(), __pos);
631 _S_copy(__newp + __pos, __s, __len2);
632 _S_copy(__newp + __pos + __len2, __p + __len1, __how_much);
633 _S_copy(this->_M_data(), __newp, __new_size);
634 this->_M_get_allocator().deallocate(__newp, __new_size);
638 if (__builtin_expect(_M_disjunct(__s),
true))
640 if (__how_much && __len1 != __len2)
641 this->_S_move(__p + __len2, __p + __len1, __how_much);
643 this->_S_copy(__p, __s, __len2);
646 _M_replace_cold(__p, __len1, __s, __len2, __how_much);
649 this->_M_mutate(__pos, __len1, __s, __len2);
651 this->_M_set_length(__new_size);
655 template<
typename _CharT,
typename _Traits,
typename _Alloc>
657 typename basic_string<_CharT, _Traits, _Alloc>::size_type
661 _M_check(__pos,
"basic_string::copy");
662 __n = _M_limit(__pos, __n);
663 __glibcxx_requires_string_len(__s, __n);
665 _S_copy(__s, _M_data() + __pos, __n);
670#ifdef __glibcxx_string_resize_and_overwrite
671 template<
typename _CharT,
typename _Traits,
typename _Alloc>
672 template<
typename _Operation>
673 [[__gnu__::__always_inline__]]
677 { resize_and_overwrite<_Operation&>(__n, __op); }
680#if __cplusplus >= 201103L
681 template<
typename _CharT,
typename _Traits,
typename _Alloc>
682 template<
typename _Operation>
683 _GLIBCXX20_CONSTEXPR
void
685#ifdef __glibcxx_string_resize_and_overwrite
686 resize_and_overwrite(
const size_type __n, _Operation __op)
688 __resize_and_overwrite(
const size_type __n, _Operation __op)
692 _CharT*
const __p = _M_data();
693#if __cpp_lib_is_constant_evaluated
694 if (std::__is_constant_evaluated() && __n >
size())
695 traits_type::assign(__p +
size(), __n -
size(), _CharT());
698 _GLIBCXX20_CONSTEXPR ~_Terminator() { _M_this->_M_set_length(_M_r); }
699 basic_string* _M_this;
702 _Terminator __term{
this, 0};
703 auto __r =
std::move(__op)(__p + 0, __n + 0);
704#ifdef __cpp_lib_concepts
705 static_assert(ranges::__detail::__is_integer_like<
decltype(__r)>);
707 static_assert(__gnu_cxx::__is_integer_nonstrict<
decltype(__r)>::__value,
708 "resize_and_overwrite operation must return an integer");
710 _GLIBCXX_DEBUG_ASSERT(__r >= 0 &&
size_type(__r) <= __n);
712 if (__term._M_r > __n)
713 __builtin_unreachable();
719#if __glibcxx_constexpr_string >= 201907L
720# define _GLIBCXX_STRING_CONSTEXPR constexpr
722# define _GLIBCXX_STRING_CONSTEXPR
724 template<
typename _CharT,
typename _Traits,
typename _Alloc>
725 _GLIBCXX_STRING_CONSTEXPR
726 typename basic_string<_CharT, _Traits, _Alloc>::size_type
728 find(
const _CharT* __s, size_type __pos, size_type __n)
const
731 __glibcxx_requires_string_len(__s, __n);
732 const size_type __size = this->
size();
735 return __pos <= __size ? __pos :
npos;
739 const _CharT __elem0 = __s[0];
740 const _CharT*
const __data =
data();
741 const _CharT* __first = __data + __pos;
742 const _CharT*
const __last = __data + __size;
743 size_type __len = __size - __pos;
748 __first = traits_type::find(__first, __len - __n + 1, __elem0);
754 if (traits_type::compare(__first, __s, __n) == 0)
755 return __first - __data;
756 __len = __last - ++__first;
761 template<
typename _CharT,
typename _Traits,
typename _Alloc>
762 _GLIBCXX_STRING_CONSTEXPR
763 typename basic_string<_CharT, _Traits, _Alloc>::size_type
765 find(_CharT __c, size_type __pos)
const _GLIBCXX_NOEXCEPT
767 size_type __ret =
npos;
768 const size_type __size = this->
size();
771 const _CharT* __data = _M_data();
772 const size_type __n = __size - __pos;
773 const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
775 __ret = __p - __data;
780 template<
typename _CharT,
typename _Traits,
typename _Alloc>
781 _GLIBCXX_STRING_CONSTEXPR
782 typename basic_string<_CharT, _Traits, _Alloc>::size_type
784 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const
787 __glibcxx_requires_string_len(__s, __n);
788 const size_type __size = this->
size();
791 __pos =
std::min(size_type(__size - __n), __pos);
792 const _CharT* __data = _M_data();
795 if (traits_type::compare(__data + __pos, __s, __n) == 0)
803 template<
typename _CharT,
typename _Traits,
typename _Alloc>
804 _GLIBCXX_STRING_CONSTEXPR
805 typename basic_string<_CharT, _Traits, _Alloc>::size_type
807 rfind(_CharT __c, size_type __pos)
const _GLIBCXX_NOEXCEPT
809 size_type __size = this->
size();
812 if (--__size > __pos)
814 for (++__size; __size-- > 0; )
815 if (traits_type::eq(_M_data()[__size], __c))
821 template<
typename _CharT,
typename _Traits,
typename _Alloc>
822 _GLIBCXX_STRING_CONSTEXPR
823 typename basic_string<_CharT, _Traits, _Alloc>::size_type
825 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const
828 __glibcxx_requires_string_len(__s, __n);
829 for (; __n && __pos < this->
size(); ++__pos)
831 const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
838 template<
typename _CharT,
typename _Traits,
typename _Alloc>
839 _GLIBCXX_STRING_CONSTEXPR
840 typename basic_string<_CharT, _Traits, _Alloc>::size_type
842 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const
845 __glibcxx_requires_string_len(__s, __n);
846 size_type __size = this->
size();
849 if (--__size > __pos)
853 if (traits_type::find(__s, __n, _M_data()[__size]))
856 while (__size-- != 0);
861 template<
typename _CharT,
typename _Traits,
typename _Alloc>
862 _GLIBCXX_STRING_CONSTEXPR
863 typename basic_string<_CharT, _Traits, _Alloc>::size_type
868 __glibcxx_requires_string_len(__s, __n);
869 for (; __pos < this->
size(); ++__pos)
870 if (!traits_type::find(__s, __n, _M_data()[__pos]))
875 template<
typename _CharT,
typename _Traits,
typename _Alloc>
876 _GLIBCXX_STRING_CONSTEXPR
877 typename basic_string<_CharT, _Traits, _Alloc>::size_type
881 for (; __pos < this->
size(); ++__pos)
882 if (!traits_type::eq(_M_data()[__pos], __c))
887 template<
typename _CharT,
typename _Traits,
typename _Alloc>
888 _GLIBCXX_STRING_CONSTEXPR
889 typename basic_string<_CharT, _Traits, _Alloc>::size_type
894 __glibcxx_requires_string_len(__s, __n);
895 size_type __size = this->
size();
898 if (--__size > __pos)
902 if (!traits_type::find(__s, __n, _M_data()[__size]))
910 template<
typename _CharT,
typename _Traits,
typename _Alloc>
911 _GLIBCXX_STRING_CONSTEXPR
912 typename basic_string<_CharT, _Traits, _Alloc>::size_type
916 size_type __size = this->
size();
919 if (--__size > __pos)
923 if (!traits_type::eq(_M_data()[__size], __c))
931#undef _GLIBCXX_STRING_CONSTEXPR
934 template<
typename _CharT,
typename _Traits,
typename _Alloc>
941 typedef typename __istream_type::ios_base __ios_base;
942 typedef typename __istream_type::int_type __int_type;
943 typedef typename __string_type::size_type __size_type;
945 typedef typename __ctype_type::ctype_base __ctype_base;
947 __size_type __extracted = 0;
948 typename __ios_base::iostate __err = __ios_base::goodbit;
949 typename __istream_type::sentry __cerb(__in,
false);
957 __size_type __len = 0;
959 const __size_type __n = __w > 0 ?
static_cast<__size_type
>(__w)
962 const __int_type __eof = _Traits::eof();
963 __int_type __c = __in.
rdbuf()->sgetc();
965 while (__extracted < __n
966 && !_Traits::eq_int_type(__c, __eof)
967 && !__ct.is(__ctype_base::space,
968 _Traits::to_char_type(__c)))
970 if (__len ==
sizeof(__buf) /
sizeof(_CharT))
972 __str.
append(__buf,
sizeof(__buf) /
sizeof(_CharT));
975 __buf[__len++] = _Traits::to_char_type(__c);
977 __c = __in.
rdbuf()->snextc();
979 __str.
append(__buf, __len);
981 if (__extracted < __n && _Traits::eq_int_type(__c, __eof))
982 __err |= __ios_base::eofbit;
987 __in._M_setstate(__ios_base::badbit);
988 __throw_exception_again;
995 __in._M_setstate(__ios_base::badbit);
1000 __err |= __ios_base::failbit;
1006 template<
typename _CharT,
typename _Traits,
typename _Alloc>
1007 basic_istream<_CharT, _Traits>&
1013 typedef typename __istream_type::ios_base __ios_base;
1014 typedef typename __istream_type::int_type __int_type;
1015 typedef typename __string_type::size_type __size_type;
1017 __size_type __extracted = 0;
1018 const __size_type __n = __str.
max_size();
1019 typename __ios_base::iostate __err = __ios_base::goodbit;
1020 typename __istream_type::sentry __cerb(__in,
true);
1026 const __int_type __idelim = _Traits::to_int_type(__delim);
1027 const __int_type __eof = _Traits::eof();
1028 __int_type __c = __in.
rdbuf()->sgetc();
1030 while (__extracted < __n
1031 && !_Traits::eq_int_type(__c, __eof)
1032 && !_Traits::eq_int_type(__c, __idelim))
1034 __str += _Traits::to_char_type(__c);
1036 __c = __in.
rdbuf()->snextc();
1039 if (_Traits::eq_int_type(__c, __eof))
1040 __err |= __ios_base::eofbit;
1041 else if (_Traits::eq_int_type(__c, __idelim))
1044 __in.
rdbuf()->sbumpc();
1047 __err |= __ios_base::failbit;
1051 __in._M_setstate(__ios_base::badbit);
1052 __throw_exception_again;
1059 __in._M_setstate(__ios_base::badbit);
1063 __err |= __ios_base::failbit;
1071#if _GLIBCXX_EXTERN_TEMPLATE
1078# if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE > 0
1079 extern template class basic_string<char>;
1080# elif ! _GLIBCXX_USE_CXX11_ABI
1083 extern template basic_string<char>::size_type
1084 basic_string<char>::_Rep::_S_empty_rep_storage[];
1085# elif _GLIBCXX_EXTERN_TEMPLATE > 0
1087 extern template void
1088 basic_string<char>::_M_replace_cold(
char *, size_type,
const char*,
1089 const size_type,
const size_type);
1093 basic_istream<char>&
1096 basic_ostream<char>&
1097 operator<<(basic_ostream<char>&,
const string&);
1099 basic_istream<char>&
1100 getline(basic_istream<char>&,
string&,
char);
1102 basic_istream<char>&
1103 getline(basic_istream<char>&,
string&);
1105#ifdef _GLIBCXX_USE_WCHAR_T
1106# if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE > 0
1107 extern template class basic_string<wchar_t>;
1108# elif ! _GLIBCXX_USE_CXX11_ABI
1109 extern template basic_string<wchar_t>::size_type
1110 basic_string<wchar_t>::_Rep::_S_empty_rep_storage[];
1111# elif _GLIBCXX_EXTERN_TEMPLATE > 0
1113 extern template void
1114 basic_string<wchar_t>::_M_replace_cold(
wchar_t*, size_type,
const wchar_t*,
1115 const size_type,
const size_type);
1119 basic_istream<wchar_t>&
1122 basic_ostream<wchar_t>&
1125 basic_istream<wchar_t>&
1128 basic_istream<wchar_t>&
1133_GLIBCXX_END_NAMESPACE_VERSION
1136#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.
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.
constexpr auto begin(_Container &__cont) noexcept(noexcept(__cont.begin())) -> decltype(__cont.begin())
Return an iterator pointing to the first element of the container.
Template class basic_istream.
void setstate(iostate __state)
Sets additional flags in the error state.
basic_streambuf< _CharT, _Traits > * rdbuf() const
Accessing the underlying buffer.
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.
Provides input iterator semantics for streambufs.
Primary class template ctype facet.