33#define _COW_STRING_H 1
35#if ! _GLIBCXX_USE_CXX11_ABI
107 template<
typename _CharT,
typename _Traits,
typename _Alloc>
110 typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
121#if __cplusplus < 201103L
122 typedef typename _CharT_alloc_type::reference
reference;
195 return *
reinterpret_cast<_Rep*
>(__p);
201#if defined(__GTHREADS)
206 return __atomic_load_n(&this->
_M_refcount, __ATOMIC_RELAXED) < 0;
215#if defined(__GTHREADS)
222 return __atomic_load_n(&this->
_M_refcount, __ATOMIC_ACQUIRE) > 0;
238#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
252 {
return reinterpret_cast<_CharT*
>(
this + 1); }
255 _M_grab(
const _Alloc& __alloc1,
const _Alloc& __alloc2)
268#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
297#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
309 struct _Alloc_hider : _Alloc
312 : _Alloc(__a),
_M_p(__dat) { }
338 {
return &((
reinterpret_cast<_Rep*
> (
_M_data()))[-1]); }
353 if (!
_M_rep()->_M_is_leaked())
360 if (__pos > this->
size())
362 "this->size() (which is %zu)"),
363 __s, __pos, this->
size());
378 const bool __testoff = __off < this->
size() - __pos;
379 return __testoff ? __off : this->
size() - __pos;
396 traits_type::assign(*__d, *__s);
398 traits_type::copy(__d, __s, __n);
405 traits_type::assign(*__d, *__s);
407 traits_type::move(__d, __s, __n);
414 traits_type::assign(*__d, __c);
416 traits_type::assign(__d, __n, __c);
421 template<
class _Iterator>
425 for (; __k1 != __k2; ++__k1, (void)++__p)
426 traits_type::assign(*__p,
static_cast<_CharT
>(*__k1));
440 {
_M_copy(__p, __k1, __k2 - __k1); }
445 {
_M_copy(__p, __k1, __k2 - __k1); }
470#ifdef __glibcxx_string_view
474 template<
typename _Tp,
typename _Res>
476 __and_<is_convertible<const _Tp&, __sv_type>,
483 _S_to_string_view(__sv_type __svt)
noexcept
492 explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { }
516#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
519#if __cpp_concepts && __glibcxx_type_trait_variable_templates
520 requires is_default_constructible_v<_Alloc>
522#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
557 const _Alloc& __a = _Alloc());
587 const _Alloc& __a = _Alloc())
596#if __cpp_deduction_guides && ! defined _GLIBCXX_DEFINING_STRING_INSTANTIATIONS
599 template<
typename = _RequireAllocator<_Alloc>>
603 __s +
npos, __a), __a)
616#if __cplusplus >= 201103L
627#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
635 if (
_M_rep()->_M_is_shared())
642#if __glibcxx_containers_ranges
647 template<__detail::__container_compatible_range<_CharT> _Rg>
648 basic_string(from_range_t, _Rg&& __rg,
const _Alloc& __a = _Alloc())
659 if constexpr (
requires {
662 -> convertible_to<const _CharT*>;
669 for (; __first != __last; ++__first)
670 traits_type::assign(*__p++,
static_cast<_CharT
>(*__first));
678 for (; __first != __last; ++__first)
700 if (__a == __str.get_allocator())
702#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
703 __str._M_data(_S_empty_rep()._M_refdata());
705 __str._M_data(_S_construct(size_type(), _CharT(), __a));
713#if __cplusplus >= 202100L
724 template<
class _InputIterator>
726 const _Alloc& __a = _Alloc())
730#ifdef __glibcxx_string_view
738 template<
typename _Tp,
741 const _Alloc& __a = _Alloc())
749 template<
typename _Tp,
typename = _If_sv<_Tp,
void>>
751 basic_string(
const _Tp& __t,
const _Alloc& __a = _Alloc())
752 :
basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { }
767 {
return this->
assign(__str); }
775 {
return this->
assign(__s); }
791#if __cplusplus >= 201103L
820#ifdef __glibcxx_string_view
825 template<
typename _Tp>
826 _If_sv<_Tp, basic_string&>
828 {
return this->
assign(__svt); }
834 operator __sv_type() const noexcept
835 {
return __sv_type(
data(),
size()); }
874 end() const _GLIBCXX_NOEXCEPT
891 const_reverse_iterator
909 const_reverse_iterator
913#if __cplusplus >= 201103L
935 const_reverse_iterator
944 const_reverse_iterator
957#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 && __OPTIMIZE__
959 __builtin_unreachable();
1000 { this->
resize(__n, _CharT()); }
1002#if __cplusplus >= 201103L
1003#pragma GCC diagnostic push
1004#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1009#pragma GCC diagnostic pop
1012#ifdef __glibcxx_string_resize_and_overwrite
1042 template<
typename _Operation>
1044 resize_and_overwrite(
size_type __n, _Operation __op);
1047#if __cplusplus >= 201103L
1049 template<
typename _Operation>
1083#if __cplusplus > 201703L
1084 [[deprecated(
"use shrink_to_fit() instead")]]
1092#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
1096 if (
_M_rep()->_M_is_shared())
1117 {
return this->
size() == 0; }
1172 if (__n >= this->
size())
1174 "(which is %zu) >= this->size() "
1196 "(which is %zu) >= this->size() "
1203#if __cplusplus >= 201103L
1257 {
return this->
append(__str); }
1266 {
return this->
append(__s); }
1280#if __cplusplus >= 201103L
1291#ifdef __glibcxx_string_view
1297 template<
typename _Tp>
1298 _If_sv<_Tp, basic_string&>
1300 {
return this->
append(__svt); }
1345 return this->
append(__s, traits_type::length(__s));
1359#if __glibcxx_containers_ranges
1364 template<__detail::__container_compatible_range<_CharT> _Rg>
1366 append_range(_Rg&& __rg)
1375#if __cplusplus >= 201103L
1394 template<
class _InputIterator>
1396 append(_InputIterator __first, _InputIterator __last)
1399#ifdef __glibcxx_string_view
1405 template<
typename _Tp>
1406 _If_sv<_Tp, basic_string&>
1409 __sv_type __sv = __svt;
1410 return this->
append(__sv.data(), __sv.size());
1421 template<
typename _Tp>
1422 _If_sv<_Tp, basic_string&>
1423 append(
const _Tp& __svt, size_type __pos, size_type __n =
npos)
1425 __sv_type __sv = __svt;
1426 return append(__sv.data()
1442 traits_type::assign(
_M_data()[this->
size()], __c);
1454#if __cplusplus >= 201103L
1487 {
return this->
assign(__str._M_data()
1488 + __str._M_check(__pos,
"basic_string::assign"),
1489 __str._M_limit(__pos, __n)); }
1517 return this->
assign(__s, traits_type::length(__s));
1541 template<
class _InputIterator>
1543 assign(_InputIterator __first, _InputIterator __last)
1546#if __glibcxx_containers_ranges
1551 template<__detail::__container_compatible_range<_CharT> _Rg>
1553 assign_range(_Rg&& __rg)
1562#if __cplusplus >= 201103L
1573#ifdef __glibcxx_string_view
1579 template<
typename _Tp>
1580 _If_sv<_Tp, basic_string&>
1583 __sv_type __sv = __svt;
1584 return this->
assign(__sv.data(), __sv.size());
1594 template<
typename _Tp>
1595 _If_sv<_Tp, basic_string&>
1596 assign(
const _Tp& __svt, size_type __pos, size_type __n =
npos)
1598 __sv_type __sv = __svt;
1599 return assign(__sv.data()
1620 { this->
replace(__p, __p, __n, __c); }
1634 template<
class _InputIterator>
1637 { this->
replace(__p, __p, __beg, __end); }
1639#if __glibcxx_containers_ranges
1644 template<__detail::__container_compatible_range<_CharT> _Rg>
1646 insert_range(const_iterator __p, _Rg&& __rg)
1648 auto __pos = __p -
cbegin();
1652 return begin() + __pos;
1662 return begin() + __pos;
1666#if __cplusplus >= 201103L
1718 {
return this->
insert(__pos1, __str._M_data()
1719 + __str._M_check(__pos2,
"basic_string::insert"),
1720 __str._M_limit(__pos2, __n)); }
1760 return this->
insert(__pos, __s, traits_type::length(__s));
1807#ifdef __glibcxx_string_view
1814 template<
typename _Tp>
1815 _If_sv<_Tp, basic_string&>
1818 __sv_type __sv = __svt;
1819 return this->
insert(__pos, __sv.data(), __sv.size());
1830 template<
typename _Tp>
1831 _If_sv<_Tp, basic_string&>
1832 insert(size_type __pos1,
const _Tp& __svt,
1833 size_type __pos2, size_type __n =
npos)
1835 __sv_type __sv = __svt;
1896#if __cplusplus >= 201103L
1929 {
return this->
replace(__pos, __n, __str._M_data(), __str.size()); }
1952 {
return this->
replace(__pos1, __n1, __str._M_data()
1953 + __str._M_check(__pos2,
"basic_string::replace"),
1954 __str._M_limit(__pos2, __n2)); }
1998 return this->
replace(__pos, __n1, __s, traits_type::length(__s));
2021 _M_limit(__pos, __n1), __n2, __c); }
2038 {
return this->
replace(__i1, __i2, __str._M_data(), __str.size()); }
2080 return this->
replace(__i1, __i2, __s, traits_type::length(__s));
2120 template<
class _InputIterator>
2123 _InputIterator __k1, _InputIterator __k2)
2146 const _CharT* __k1,
const _CharT* __k2)
2162 __k1.
base(), __k2 - __k1);
2173 __k1.
base(), __k2 - __k1);
2176#if __glibcxx_containers_ranges
2181 template<__detail::__container_compatible_range<_CharT> _Rg>
2183 replace_with_range(const_iterator __i1, const_iterator __i2, _Rg&& __rg)
2197#if __cplusplus >= 201103L
2217#ifdef __glibcxx_string_view
2225 template<
typename _Tp>
2226 _If_sv<_Tp, basic_string&>
2229 __sv_type __sv = __svt;
2230 return this->
replace(__pos, __n, __sv.data(), __sv.size());
2242 template<
typename _Tp>
2243 _If_sv<_Tp, basic_string&>
2244 replace(size_type __pos1, size_type __n1,
const _Tp& __svt,
2245 size_type __pos2, size_type __n2 =
npos)
2247 __sv_type __sv = __svt;
2248 return this->
replace(__pos1, __n1,
2263 template<
typename _Tp>
2264 _If_sv<_Tp, basic_string&>
2267 __sv_type __sv = __svt;
2268 return this->
replace(__i1 -
begin(), __i2 - __i1, __sv);
2273 template<
class _Integer>
2279 template<
class _InputIterator>
2294 template<
class _InIterator>
2305 template<
class _Integer>
2316 template<
class _InIterator>
2325 template<
class _InIterator>
2332 template<
class _FwdIterator>
2391#if __cplusplus >= 201703L
2447 {
return this->
find(__str.data(), __pos, __str.size()); }
2463 return this->
find(__s, __pos, traits_type::length(__s));
2479#ifdef __glibcxx_string_view
2486 template<
typename _Tp>
2487 _If_sv<_Tp, size_type>
2489 noexcept(
is_same<_Tp, __sv_type>::value)
2491 __sv_type __sv = __svt;
2492 return this->
find(__sv.data(), __pos, __sv.size());
2509 {
return this->
rfind(__str.data(), __pos, __str.size()); }
2541 return this->
rfind(__s, __pos, traits_type::length(__s));
2557#ifdef __glibcxx_string_view
2564 template<
typename _Tp>
2565 _If_sv<_Tp, size_type>
2569 __sv_type __sv = __svt;
2570 return this->
rfind(__sv.data(), __pos, __sv.size());
2588 {
return this->
find_first_of(__str.data(), __pos, __str.size()); }
2621 return this->
find_first_of(__s, __pos, traits_type::length(__s));
2638 {
return this->
find(__c, __pos); }
2640#ifdef __glibcxx_string_view
2648 template<
typename _Tp>
2649 _If_sv<_Tp, size_type>
2651 noexcept(
is_same<_Tp, __sv_type>::value)
2653 __sv_type __sv = __svt;
2654 return this->
find_first_of(__sv.data(), __pos, __sv.size());
2672 {
return this->
find_last_of(__str.data(), __pos, __str.size()); }
2705 return this->
find_last_of(__s, __pos, traits_type::length(__s));
2722 {
return this->
rfind(__c, __pos); }
2724#ifdef __glibcxx_string_view
2732 template<
typename _Tp>
2733 _If_sv<_Tp, size_type>
2737 __sv_type __sv = __svt;
2738 return this->
find_last_of(__sv.data(), __pos, __sv.size());
2805#ifdef __glibcxx_string_view
2813 template<
typename _Tp>
2814 _If_sv<_Tp, size_type>
2816 noexcept(
is_same<_Tp, __sv_type>::value)
2818 __sv_type __sv = __svt;
2887#ifdef __glibcxx_string_view
2895 template<
typename _Tp>
2896 _If_sv<_Tp, size_type>
2900 __sv_type __sv = __svt;
2920 _M_check(__pos,
"basic_string::substr"), __n); }
2922#ifdef __glibcxx_string_subview
2938 {
return __sv_type(*this).subview(__pos, __n); }
2959 const size_type __osize = __str.size();
2962 int __r = traits_type::compare(
_M_data(), __str.data(), __len);
2968#ifdef __glibcxx_string_view
2974 template<
typename _Tp>
2976 compare(
const _Tp& __svt)
const
2979 __sv_type __sv = __svt;
2981 const size_type __osize = __sv.size();
2984 int __r = traits_type::compare(
_M_data(), __sv.data(), __len);
2998 template<
typename _Tp>
3000 compare(size_type __pos, size_type __n,
const _Tp& __svt)
const
3002 __sv_type __sv = __svt;
3003 return __sv_type(*this).substr(__pos, __n).compare(__sv);
3016 template<
typename _Tp>
3021 __sv_type __sv = __svt;
3022 return __sv_type(*
this)
3023 .substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
3049 _M_check(__pos,
"basic_string::compare");
3053 int __r = traits_type::compare(
_M_data() + __pos, __str.data(), __len);
3086 _M_check(__pos1,
"basic_string::compare");
3087 __str._M_check(__pos2,
"basic_string::compare");
3089 __n2 = __str._M_limit(__pos2, __n2);
3091 int __r = traits_type::compare(
_M_data() + __pos1,
3092 __str.data() + __pos2, __len);
3113 compare(
const _CharT* __s)
const _GLIBCXX_NOEXCEPT
3117 const size_type __osize = traits_type::length(__s);
3119 int __r = traits_type::compare(
_M_data(), __s, __len);
3150 _M_check(__pos,
"basic_string::compare");
3152 const size_type __osize = traits_type::length(__s);
3154 int __r = traits_type::compare(
_M_data() + __pos, __s, __len);
3189 _M_check(__pos,
"basic_string::compare");
3192 int __r = traits_type::compare(
_M_data() + __pos, __s, __len);
3198#if __cplusplus > 201703L
3201 {
return __sv_type(this->
data(), this->
size()).starts_with(__x); }
3205 {
return __sv_type(this->
data(), this->
size()).starts_with(__x); }
3207 [[__gnu__::__nonnull__]]
3210 {
return __sv_type(this->
data(), this->
size()).starts_with(__x); }
3214 {
return __sv_type(this->
data(), this->
size()).ends_with(__x); }
3218 {
return __sv_type(this->
data(), this->
size()).ends_with(__x); }
3220 [[__gnu__::__nonnull__]]
3223 {
return __sv_type(this->
data(), this->
size()).ends_with(__x); }
3226#if __cplusplus > 202011L
3229 {
return __sv_type(this->
data(), this->
size()).contains(__x); }
3232 contains(_CharT __x)
const noexcept
3233 {
return __sv_type(this->
data(), this->
size()).contains(__x); }
3235 [[__gnu__::__nonnull__]]
3237 contains(
const _CharT* __x)
const noexcept
3238 {
return __sv_type(this->
data(), this->
size()).contains(__x); }
3241# ifdef _GLIBCXX_TM_TS_INTERNAL
3243 ::_txnal_cow_string_C1_for_exceptions(
void* that,
const char* s,
3246 ::_txnal_cow_string_c_str(
const void *that);
3248 ::_txnal_cow_string_D1(
void *that);
3250 ::_txnal_cow_string_D1_commit(
void *that);
3254 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3257 _Rep::_S_max_size = (((
npos -
sizeof(_Rep_base))/
sizeof(_CharT)) - 1) / 4;
3259 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3262 _Rep::_S_terminal = _CharT();
3264 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3270 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3273 (
sizeof(_Rep_base) +
sizeof(_CharT) +
sizeof(
size_type) - 1) /
3280 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3281 template<
typename _InIterator>
3284 _S_construct(_InIterator __beg, _InIterator __end,
const _Alloc& __a,
3287#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
3288 if (__beg == __end && __a == _Alloc())
3294 while (__beg != __end && __len <
sizeof(__buf) /
sizeof(_CharT))
3296 __buf[__len++] = *__beg;
3303 while (__beg != __end)
3326 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3327 template <
typename _InIterator>
3330 _S_construct(_InIterator __beg, _InIterator __end,
const _Alloc& __a,
3333#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
3334 if (__beg == __end && __a == _Alloc())
3349 __r->_M_destroy(__a);
3352 __r->_M_set_length_and_sharable(__dnew);
3353 return __r->_M_refdata();
3356 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3361#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
3362 if (__n == 0 && __a == _Alloc())
3374 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3377 : _M_dataplus(_S_construct(__str._M_data()
3378 + __str._M_check(__pos,
3379 "basic_string::basic_string"),
3380 __str._M_data() + __str._M_limit(__pos,
npos)
3384 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3385 basic_string<_CharT, _Traits, _Alloc>::
3386 basic_string(
const basic_string& __str, size_type __pos, size_type __n)
3387 : _M_dataplus(_S_construct(__str._M_data()
3388 + __str._M_check(__pos,
3389 "basic_string::basic_string"),
3390 __str._M_data() + __str._M_limit(__pos, __n)
3391 + __pos, _Alloc()), _Alloc())
3394 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3398 : _M_dataplus(_S_construct(__str._M_data()
3399 + __str._M_check(__pos,
3400 "basic_string::basic_string"),
3401 __str._M_data() + __str._M_limit(__pos, __n)
3405 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3410 if (_M_rep() != __str._M_rep())
3413 const allocator_type __a = this->get_allocator();
3414 _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
3415 _M_rep()->_M_dispose(__a);
3421 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3427 _M_check_length(this->
size(), __n,
"basic_string::assign");
3428 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
3429 return _M_replace_safe(
size_type(0), this->
size(), __s, __n);
3433 const size_type __pos = __s - _M_data();
3435 _M_copy(_M_data(), __s, __n);
3437 _M_move(_M_data(), __s, __n);
3438 _M_rep()->_M_set_length_and_sharable(__n);
3443 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3450 _M_check_length(
size_type(0), __n,
"basic_string::append");
3452 if (__len > this->capacity() || _M_rep()->_M_is_shared())
3453 this->reserve(__len);
3454 _M_assign(_M_data() + this->
size(), __n, __c);
3455 _M_rep()->_M_set_length_and_sharable(__len);
3460 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3468 _M_check_length(
size_type(0), __n,
"basic_string::append");
3470 if (__len > this->capacity() || _M_rep()->_M_is_shared())
3472 if (_M_disjunct(__s))
3473 this->reserve(__len);
3476 const size_type __off = __s - _M_data();
3477 this->reserve(__len);
3478 __s = _M_data() + __off;
3481 _M_copy(_M_data() + this->
size(), __s, __n);
3482 _M_rep()->_M_set_length_and_sharable(__len);
3487 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3496 if (__len > this->capacity() || _M_rep()->_M_is_shared())
3497 this->reserve(__len);
3498 _M_copy(_M_data() + this->
size(), __str._M_data(), __size);
3499 _M_rep()->_M_set_length_and_sharable(__len);
3504 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3509 __str._M_check(__pos,
"basic_string::append");
3510 __n = __str._M_limit(__pos, __n);
3514 if (__len > this->capacity() || _M_rep()->_M_is_shared())
3515 this->reserve(__len);
3516 _M_copy(_M_data() + this->
size(), __str._M_data() + __pos, __n);
3517 _M_rep()->_M_set_length_and_sharable(__len);
3522 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3528 _M_check(__pos,
"basic_string::insert");
3529 _M_check_length(
size_type(0), __n,
"basic_string::insert");
3530 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
3531 return _M_replace_safe(__pos,
size_type(0), __s, __n);
3535 const size_type __off = __s - _M_data();
3536 _M_mutate(__pos, 0, __n);
3537 __s = _M_data() + __off;
3538 _CharT* __p = _M_data() + __pos;
3539 if (__s + __n <= __p)
3540 _M_copy(__p, __s, __n);
3541 else if (__s >= __p)
3542 _M_copy(__p, __s + __n, __n);
3546 _M_copy(__p, __s, __nleft);
3547 _M_copy(__p + __nleft, __p + __n, __n - __nleft);
3553 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3564 const size_type __size = __last - __first;
3569 _M_rep()->_M_set_leaked();
3576 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3583 _M_check(__pos,
"basic_string::replace");
3584 __n1 = _M_limit(__pos, __n1);
3585 _M_check_length(__n1, __n2,
"basic_string::replace");
3587 if (_M_disjunct(__s) || _M_rep()->_M_is_shared())
3588 return _M_replace_safe(__pos, __n1, __s, __n2);
3589 else if ((__left = __s + __n2 <= _M_data() + __pos)
3590 || _M_data() + __pos + __n1 <= __s)
3594 __left ? __off : (__off += __n2 - __n1);
3595 _M_mutate(__pos, __n1, __n2);
3596 _M_copy(_M_data() + __pos, _M_data() + __off, __n2);
3602 const basic_string __tmp(__s, __n2);
3603 return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
3607 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3617 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3629 if (
_M_rep()->_M_is_shared())
3631 _M_rep()->_M_set_leaked();
3634 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3640 const size_type __new_size = __old_size + __len2 - __len1;
3641 const size_type __how_much = __old_size - __pos - __len1;
3653 _M_data() + __pos + __len1, __how_much);
3655 _M_rep()->_M_dispose(__a);
3658 else if (__how_much && __len1 != __len2)
3662 _M_data() + __pos + __len1, __how_much);
3664 _M_rep()->_M_set_length_and_sharable(__new_size);
3667 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3678 if (__res <= __capacity)
3680 if (!
_M_rep()->_M_is_shared())
3688 _CharT* __tmp =
_M_rep()->_M_clone(__a, __res - this->
size());
3689 _M_rep()->_M_dispose(__a);
3693 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3699 if (
_M_rep()->_M_is_leaked())
3700 _M_rep()->_M_set_sharable();
3701 if (__s._M_rep()->_M_is_leaked())
3702 __s._M_rep()->_M_set_sharable();
3713 __s.get_allocator());
3714 const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
3715 this->get_allocator());
3721 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3725 const _Alloc& __alloc)
3756 const size_type __malloc_header_size = 4 *
sizeof(
void*);
3764 if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
3765 __capacity = 2 * __old_capacity;
3770 size_type __size = (__capacity + 1) *
sizeof(_CharT) +
sizeof(
_Rep);
3772 const size_type __adj_size = __size + __malloc_header_size;
3773 if (__adj_size > __pagesize && __capacity > __old_capacity)
3775 const size_type __extra = __pagesize - __adj_size % __pagesize;
3776 __capacity += __extra /
sizeof(_CharT);
3780 __size = (__capacity + 1) *
sizeof(_CharT) +
sizeof(
_Rep);
3799 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3815 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3823 this->
append(__n - __size, __c);
3824 else if (__n < __size)
3829 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3830 template<
typename _InputIterator>
3838 _M_check_length(__n1, __s.size(),
"basic_string::_M_replace_dispatch");
3843 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3856 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3868 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3889 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3894 _M_check(__pos,
"basic_string::copy");
3903#ifdef __glibcxx_string_resize_and_overwrite
3904 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3905 template<
typename _Operation>
3906 [[__gnu__::__always_inline__]]
3910 { resize_and_overwrite<_Operation&>(__n, __op); }
3913#if __cplusplus >= 201103L
3914 template<
typename _CharT,
typename _Traits,
typename _Alloc>
3915 template<
typename _Operation>
3918#ifdef __glibcxx_string_resize_and_overwrite
3919 resize_and_overwrite(
const size_type __n, _Operation __op)
3926 if (__n > __capacity ||
_M_rep()->_M_is_shared())
3929 struct _Terminator {
3930 ~_Terminator() { _M_this->_M_rep()->_M_set_length_and_sharable(_M_r); }
3934 _Terminator __term{
this, 0};
3935 auto __r =
std::move(__op)(__p + 0, __n + 0);
3936#ifdef __cpp_lib_concepts
3940 "resize_and_overwrite operation must return an integer");
3944 if (__term._M_r > __n)
3945 __builtin_unreachable();
#define __throw_exception_again
#define _GLIBCXX_VISIBILITY(V)
#define __glibcxx_assert(cond)
#define _GLIBCXX_NODISCARD
#define _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
#define __glibcxx_requires_string(_String)
#define __glibcxx_requires_string_len(_String, _Len)
#define __glibcxx_requires_valid_range(_First, _Last)
#define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A)
#define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A)
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
decltype(nullptr) nullptr_t
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
const basic_string< _CharT, _Traits, _Alloc >::size_type basic_string< _CharT, _Traits, _Alloc >::npos
constexpr size_t __sv_limit(size_t __size, size_t __pos, size_t __off) noexcept
void __throw_logic_error(const char *)
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
constexpr size_t __sv_check(size_t __size, size_t __pos, const char *__s)
void __throw_out_of_range_fmt(const char *,...)
void __throw_length_error(const char *)
ISO C++ entities toplevel namespace is std.
bool contains(bool_set __s, bool_set __t)
constexpr bool __is_null_pointer(_Type *__ptr)
_Atomic_word __exchange_and_add_dispatch(_Atomic_word *__mem, int __val)
void __atomic_add_dispatch(_Atomic_word *__mem, int __val)
bool __is_single_threaded() noexcept
constexpr __distance_fn distance
constexpr ranges::__access::_Empty empty
constexpr ranges::__access::_Data data
constexpr ranges::__access::_Begin begin
constexpr ranges::__access::_End end
constexpr size_type size() const noexcept
constexpr const_iterator end() const noexcept
constexpr const_iterator begin() const noexcept
A non-owning reference to a string.
int compare(size_type __pos1, size_type __n1, const basic_string &__str, size_type __pos2, size_type __n2=npos) const
Compare substring to a substring.
const_reverse_iterator crbegin() const noexcept
basic_string & insert(size_type __pos, const _CharT *__s, size_type __n)
Insert a C substring.
void swap(basic_string &__s) noexcept(/*conditional */)
Swap contents with another string.
basic_string & operator=(const _CharT *__s)
Copy contents of s into this string.
void push_back(_CharT __c)
Append a single character.
_Alloc_traits::size_type size_type
const_iterator cend() const noexcept
basic_string & operator+=(initializer_list< _CharT > __l)
Append an initializer_list of characters.
bool starts_with(_CharT __x) const noexcept
size_type find(const _CharT *__s, size_type __pos=0) const noexcept
Find position of a C string.
bool ends_with(basic_string_view< _CharT, _Traits > __x) const noexcept
constexpr basic_string() noexcept(/*conditional */)
Default constructor creates an empty string.
basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc &__a=_Alloc())
Construct string as copy of a range.
basic_string & replace(iterator __i1, iterator __i2, const _CharT *__s, size_type __n)
Replace range of characters with C substring.
__gnu_cxx::__alloc_traits< _Alloc >::template rebind< _CharT >::other _CharT_alloc_type
constexpr void _M_length(size_type __length)
basic_string & assign(initializer_list< _CharT > __l)
Set value to an initializer_list of characters.
basic_string & append(size_type __n, _CharT __c)
Append multiple characters.
std::reverse_iterator< iterator > reverse_iterator
size_type find_first_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character of string.
constexpr size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
iterator erase(iterator __first, iterator __last)
Remove a range of characters.
constexpr void clear() noexcept
constexpr pointer _M_data() const
static void _S_copy_chars(_CharT *__p, _Iterator __k1, _Iterator __k2)
const _CharT * data() const noexcept
Return const pointer to contents.
size_type find_last_of(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find last position of a character of C substring.
basic_string(const _Alloc &__a)
Construct an empty string using allocator a.
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.
size_type find_last_of(const _CharT *__s, size_type __pos=npos) const noexcept
Find last position of a character of C string.
_CharT * _M_data(_CharT *__p) noexcept
int compare(const _CharT *__s) const noexcept
Compare to a C string.
void insert(iterator __p, initializer_list< _CharT > __l)
Insert an initializer_list of characters.
basic_string & _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n, _Integer __val, __true_type)
basic_string & insert(size_type __pos1, const basic_string &__str)
Insert value of a string.
constexpr basic_string & _M_replace_dispatch(const_iterator __i1, const_iterator __i2, _Integer __n, _Integer __val, __true_type)
basic_string & _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2, __false_type)
_CharT * _M_data() const noexcept
void __resize_and_overwrite(size_type __n, _Operation __op)
Non-standard version of resize_and_overwrite for C++11 and above.
size_type rfind(const _CharT *__s, size_type __pos=npos) const noexcept
Find last position of a C string.
basic_string substr(size_type __pos=0, size_type __n=npos) const
Get a substring.
void reserve(size_type __res_arg)
Attempt to preallocate enough memory for specified number of characters.
iterator erase(iterator __position)
Remove one character.
constexpr size_type find(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find position of a C substring.
size_type find(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a string.
constexpr size_type _M_limit(size_type __pos, size_type __off) const noexcept
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 copy(_CharT *__s, size_type __n, size_type __pos=0) const
Copy substring into C string.
int compare(size_type __pos, size_type __n, const basic_string &__str) const
Compare substring to a string.
basic_string() noexcept
Default constructor creates an empty string.
constexpr const _CharT * data() const noexcept
Return const pointer to contents.
basic_string(const basic_string &__str)
Construct string with copy of value of str.
int compare(const basic_string &__str) const
Compare to a string.
int compare(size_type __pos, size_type __n1, const _CharT *__s) const
Compare substring to a C string.
constexpr basic_string substr(size_type __pos=0, size_type __n=npos) const
Get a substring.
basic_string & assign(const _CharT *__s, size_type __n)
Set value to a C substring.
basic_string & replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
int compare(size_type __pos, size_type __n1, const _CharT *__s, size_type __n2) const
Compare substring against a character array.
void _M_check_length(size_type __n1, size_type __n2, const char *__s) const
basic_string & replace(iterator __i1, iterator __i2, const basic_string &__str)
Replace range of characters with string.
basic_string(const basic_string &__str, size_type __pos, const _Alloc &__a=_Alloc())
Construct string as copy of a substring.
basic_string(const basic_string &__str, size_type __pos, size_type __n)
Construct string as copy of a substring.
static _CharT * _S_construct_aux_2(size_type __req, _CharT __c, const _Alloc &__a)
static _CharT * _S_construct_aux(_InIterator __beg, _InIterator __end, const _Alloc &__a, __false_type)
_Alloc_traits::reference reference
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 front() const noexcept
size_type find_last_not_of(const _CharT *__s, size_type __pos=npos) const noexcept
Find last position of a character not in C string.
void insert(iterator __p, size_type __n, _CharT __c)
Insert multiple characters.
static constexpr int _S_compare(size_type __n1, size_type __n2) noexcept
constexpr basic_string & assign(const basic_string &__str)
Set value to contents of another string.
static _CharT * _S_construct(_InIterator __beg, _InIterator __end, const _Alloc &__a, input_iterator_tag)
reverse_iterator rbegin()
basic_string & insert(size_type __pos1, const basic_string &__str, size_type __pos2, size_type __n=npos)
Insert a substring.
basic_string(initializer_list< _CharT > __l, const _Alloc &__a=_Alloc())
Construct string from an initializer list.
basic_string(const basic_string &__str, const _Alloc &__a)
constexpr size_type length() const noexcept
constexpr void _M_data(pointer __p)
static _CharT * _S_construct_aux(_Integer __beg, _Integer __end, const _Alloc &__a, __true_type)
basic_string(basic_string &&__str, const _Alloc &__a)
basic_string(const basic_string &__str, size_type __pos, size_type __n, const _Alloc &__a)
Construct string as copy of a substring.
basic_string & replace(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2)
Replace range of characters with range.
basic_string & assign(basic_string &&__str) noexcept(allocator_traits< _Alloc >::is_always_equal::value)
Set value to contents of another string.
static _CharT * _S_construct(_InIterator __beg, _InIterator __end, const _Alloc &__a)
void pop_back()
Remove the last character.
size_type _M_check(size_type __pos, const char *__s) const
basic_string(basic_string &&__str) noexcept
Move construct string.
constexpr 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.
static void _S_copy_chars(_CharT *__p, iterator __k1, iterator __k2) noexcept
basic_string & replace(iterator __i1, iterator __i2, _CharT *__k1, _CharT *__k2)
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 _M_limit(size_type __pos, size_type __off) const noexcept
constexpr const_iterator cbegin() const noexcept
size_type find_first_not_of(_CharT __c, size_type __pos=0) const noexcept
Find position of a different character.
basic_string & operator+=(const basic_string &__str)
Append a string to this string.
size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
constexpr size_type _M_check(size_type __pos, const char *__s) const
iterator _M_ibegin() const noexcept
size_type rfind(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a string.
constexpr size_type find_first_of(const basic_string &__str, size_type __pos=0) const noexcept
Find position of a character of string.
basic_string & operator+=(const _CharT *__s)
Append a C string.
basic_string(size_type __n, _CharT __c, const _Alloc &__a=_Alloc())
Construct string as multiple characters.
void shrink_to_fit() noexcept
A non-binding request to reduce capacity() to size().
void resize(size_type __n, _CharT __c)
Resizes the string to the specified number of characters.
_CharT * data() noexcept(false)
Return non-const pointer to contents.
static constexpr void _S_copy_chars(_CharT *__p, _Iterator __k1, _Iterator __k2)
bool starts_with(basic_string_view< _CharT, _Traits > __x) const noexcept
size_type find(_CharT __c, size_type __pos=0) const noexcept
Find position of a character.
const_reference at(size_type __n) const
Provides access to the data contained in the string.
const_reference back() const noexcept
const_reverse_iterator rend() const noexcept
static _CharT * _S_construct(size_type __req, _CharT __c, const _Alloc &__a)
bool ends_with(const _CharT *__x) const noexcept
__gnu_cxx::__alloc_traits< _CharT_alloc_type > _CharT_alloc_traits
_Char_alloc_type allocator_type
const_iterator end() const noexcept
iterator _M_iend() const noexcept
constexpr void __resize_and_overwrite(size_type __n, _Operation __op)
Non-standard version of resize_and_overwrite for C++11 and above.
basic_string & replace(size_type __pos, size_type __n1, const _CharT *__s, size_type __n2)
Replace characters with value of a C substring.
size_type find_last_of(_CharT __c, size_type __pos=npos) const noexcept
Find last position of a character.
constexpr void _M_check_length(size_type __n1, size_type __n2, const char *__s) const
constexpr size_type rfind(const basic_string &__str, size_type __pos=npos) const noexcept
Find last position of a string.
basic_string & _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, _CharT __c)
constexpr basic_string & append(const basic_string &__str)
Append a string to this string.
const_iterator begin() const noexcept
basic_string & operator=(basic_string &&__str) noexcept(/*conditional */)
Move assign the value of str to this string.
basic_string & replace(iterator __i1, iterator __i2, initializer_list< _CharT > __l)
Replace range of characters with initializer_list.
constexpr basic_string & operator=(const basic_string &__str)
Assign the value of str to this string.
basic_string & operator+=(_CharT __c)
Append a character.
const_reverse_iterator crend() const noexcept
basic_string & operator=(const basic_string &__str)
Assign the value of str to this string.
basic_string & operator=(_CharT __c)
Set value to string of length 1.
void resize(size_type __n)
Resizes the string to the specified number of characters.
const_reverse_iterator rbegin() const noexcept
constexpr 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 find_last_not_of(_CharT __c, size_type __pos=npos) const noexcept
Find last position of a different character.
static void _S_copy_chars(_CharT *__p, const_iterator __k1, const_iterator __k2) noexcept
basic_string & replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2)
constexpr iterator end() noexcept
basic_string & replace(iterator __i1, iterator __i2, const _CharT *__k1, const _CharT *__k2)
_Traits::char_type value_type
constexpr iterator begin() noexcept
bool _M_disjunct(const _CharT *__s) const noexcept
basic_string & _M_replace_safe(size_type __pos1, size_type __n1, const _CharT *__s, size_type __n2)
basic_string & append(const _CharT *__s, size_type __n)
Append a C substring.
_Alloc_traits::pointer pointer
basic_string & assign(_InputIterator __first, _InputIterator __last)
Set value to a range of characters.
static void _S_copy_chars(_CharT *__p, _CharT *__k1, _CharT *__k2) noexcept
basic_string & append(initializer_list< _CharT > __l)
Append an initializer_list of characters.
basic_string & append(const basic_string &__str, size_type __pos, size_type __n=npos)
Append a substring.
basic_string & append(_InputIterator __first, _InputIterator __last)
Append a range of characters.
basic_string & assign(const basic_string &__str)
Set value to contents of another string.
basic_string(const _CharT *__s, const _Alloc &__a=_Alloc())
Construct string as copy of a C string.
constexpr void push_back(_CharT __c)
Append a single character.
size_type find_first_of(_CharT __c, size_type __pos=0) const noexcept
Find position of a character.
basic_string & assign(size_type __n, _CharT __c)
Set value to multiple characters.
basic_string & replace(iterator __i1, iterator __i2, const _CharT *__s)
Replace range of characters with C string.
bool empty() const noexcept
constexpr void _M_mutate(size_type __pos, size_type __len1, const _CharT *__s, size_type __len2)
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.
bool starts_with(const _CharT *__x) const noexcept
static _CharT * _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc &__a, forward_iterator_tag)
basic_string & insert(size_type __pos, const _CharT *__s)
Insert a C string.
constexpr iterator insert(const_iterator __p, size_type __n, _CharT __c)
Insert multiple characters.
basic_string & assign(const basic_string &__str, size_type __pos, size_type __n=npos)
Set value to a substring of a string.
constexpr size_type capacity() const noexcept
const _CharT * c_str() const noexcept
Return const pointer to null-terminated contents.
static _Rep & _S_empty_rep() noexcept
basic_string & replace(size_type __pos, size_type __n1, const _CharT *__s)
Replace characters with value of a C string.
_Rep * _M_rep() const noexcept
constexpr bool empty() const noexcept
size_type find(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find position of a C substring.
_Alloc_traits::const_reference const_reference
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.
allocator_type get_allocator() const noexcept
Return copy of allocator used to construct this string.
_Alloc_traits::const_pointer const_pointer
basic_string & assign(const _CharT *__s)
Set value to contents of a C string.
basic_string & append(const basic_string &__str)
Append a string to this string.
size_type find_first_not_of(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find position of a character not in C substring.
basic_string & replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
Replace characters with multiple characters.
const_iterator cbegin() const noexcept
constexpr allocator_type get_allocator() const noexcept
constexpr basic_string & _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, _CharT __c)
std::reverse_iterator< const_iterator > const_reverse_iterator
constexpr basic_string & replace(size_type __pos, size_type __n, const basic_string &__str)
Replace characters with value from another string.
basic_string & replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
Replace range of characters with multiple characters.
const_iterator __const_iterator
__gnu_cxx::__normal_iterator< pointer, basic_string > iterator
basic_string & operator=(initializer_list< _CharT > __l)
Set value to string constructed from initializer list.
~basic_string() noexcept
Destroy the string instance.
bool ends_with(_CharT __x) const noexcept
size_type capacity() const noexcept
static void _M_move(_CharT *__d, const _CharT *__s, size_type __n) noexcept
size_type find_first_of(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find position of a character of C substring.
void insert(iterator __p, _InputIterator __beg, _InputIterator __end)
Insert a range of characters.
constexpr int compare(const basic_string &__str) const
Compare to a string.
static int _S_compare(size_type __n1, size_type __n2) noexcept
_Alloc_traits::difference_type difference_type
void _M_mutate(size_type __pos, size_type __len1, size_type __len2)
size_type find_first_of(const _CharT *__s, size_type __pos=0) const noexcept
Find position of a character of C string.
size_type rfind(_CharT __c, size_type __pos=npos) const noexcept
Find last position of a character.
size_type max_size() const noexcept
Returns the size() of the largest possible string.
reference operator[](size_type __pos)
Subscript access to the data contained in the string.
static void _M_assign(_CharT *__d, size_type __n, _CharT __c) noexcept
basic_string & insert(size_type __pos, size_type __n, _CharT __c)
Insert multiple characters.
static void _S_copy_chars(_CharT *__p, const _CharT *__k1, const _CharT *__k2) noexcept
basic_string & erase(size_type __pos=0, size_type __n=npos)
Remove characters.
basic_string & replace(size_type __pos1, size_type __n1, const basic_string &__str, size_type __pos2, size_type __n2=npos)
Replace characters with value from another string.
constexpr size_type max_size() const noexcept
Returns the size() of the largest possible string.
basic_string(const _CharT *__s, size_type __n, const _Alloc &__a=_Alloc())
Construct string initialized by a character array.
constexpr void swap(basic_string &__s) noexcept
Swap contents with another string.
constexpr void _M_assign(const basic_string &)
basic_string & append(const _CharT *__s)
Append a C string.
__gnu_cxx::__normal_iterator< const_pointer, basic_string > const_iterator
constexpr const_reference operator[](size_type __pos) const noexcept
Subscript access to the data contained in the string.
basic_string & replace(size_type __pos, size_type __n, const basic_string &__str)
Replace characters with value from another string.
size_type rfind(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find last position of a C substring.
constexpr basic_string & operator+=(const basic_string &__str)
Append a string to this string.
size_type find_first_not_of(const _CharT *__s, size_type __pos=0) const noexcept
Find position of a character not in C string.
size_type find_last_not_of(const _CharT *__s, size_type __pos, size_type __n) const noexcept
Find last position of a character not in C substring.
constexpr const_iterator cend() const noexcept
reference at(size_type __n)
Provides access to the data contained in the string.
iterator insert(iterator __p, _CharT __c)
Insert one character.
static void _M_copy(_CharT *__d, const _CharT *__s, size_type __n) noexcept
Managing sequences of characters and character-like objects.
_Alloc_hider(_CharT *__dat, const _Alloc &__a) noexcept
static const size_type _S_max_size
_CharT * _M_clone(const _Alloc &, size_type __res=0)
static size_type _S_empty_rep_storage[]
bool _M_is_leaked() const noexcept
void _M_set_length_and_sharable(size_type __n) noexcept
void _M_set_sharable() noexcept
static _Rep * _S_create(size_type, size_type, const _Alloc &)
void _M_dispose(const _Alloc &__a) noexcept
static const _CharT _S_terminal
__gnu_cxx::__alloc_traits< _Alloc >::template rebind< char >::other _Raw_bytes_alloc
_CharT * _M_grab(const _Alloc &__alloc1, const _Alloc &__alloc2)
void _M_destroy(const _Alloc &)
void _M_set_leaked() noexcept
bool _M_is_shared() const noexcept
static _Rep & _S_empty_rep() noexcept
Thrown as part of forced unwinding.
Traits class for iterators.
One of the comparison functors.
constexpr const _Iterator & base() const noexcept
Forward iterators support a superset of input iterator operations.
_Base_type::pointer pointer
_Base_type::difference_type difference_type
_Base_type::const_pointer const_pointer
_Base_type::size_type size_type
Uniform interface to C++98 and C++11 allocators.
static const _Value __max
static const _Value __min
[range.sized] The sized_range concept.
A range for which ranges::begin returns a forward iterator.
A range for which ranges::begin returns a contiguous iterator.