96 basic_string<_CharT, _Traits, _Allocator>,
97 _Allocator, _Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>,
105 template<
typename _ItT,
typename _SeqT,
typename _CatT>
106 friend class ::__gnu_debug::_Safe_iterator;
114 typedef _Traits traits_type;
115 typedef typename _Traits::char_type value_type;
116 typedef _Allocator allocator_type;
117 typedef typename _Base::size_type size_type;
118 typedef typename _Base::difference_type difference_type;
119 typedef typename _Base::reference reference;
120 typedef typename _Base::const_reference const_reference;
121 typedef typename _Base::pointer pointer;
122 typedef typename _Base::const_pointer const_pointer;
140#if __cplusplus < 201103L
153 const _Allocator& __a = _Allocator())
158 :
_Base(__s, __a) { }
182 const _Allocator& __a = _Allocator())
183 :
_Base(__str, __pos, __n, __a) { }
186 const _Allocator& __a = _Allocator())
187 :
_Base(__glibcxx_check_string_n_constructor(__s, __n), __n, __a) { }
189 basic_string(
const _CharT* __s,
const _Allocator& __a = _Allocator())
190 :
_Base(__glibcxx_check_string_constructor(__s), __a)
194 const _Allocator& __a = _Allocator())
195 :
_Base(__n, __c, __a) { }
197 template<
typename _InputIterator>
198 basic_string(_InputIterator __begin, _InputIterator __end,
199 const _Allocator& __a = _Allocator())
201 __glibcxx_check_valid_constructor_range(__begin, __end)),
204#if __cplusplus >= 201103L
213 operator=(
const _CharT* __s)
215 __glibcxx_check_string(__s);
217 this->_M_invalidate_all();
222 operator=(_CharT __c)
225 this->_M_invalidate_all();
229#if __cplusplus >= 201103L
234 this->_M_invalidate_all();
245 begin()
const _GLIBCXX_NOEXCEPT
253 end()
const _GLIBCXX_NOEXCEPT
261 rbegin()
const _GLIBCXX_NOEXCEPT
269 rend()
const _GLIBCXX_NOEXCEPT
272#if __cplusplus >= 201103L
274 cbegin()
const noexcept
278 cend()
const noexcept
282 crbegin()
const noexcept
286 crend()
const noexcept
296 resize(size_type __n, _CharT __c)
299 this->_M_invalidate_all();
303 resize(size_type __n)
304 { this->resize(__n, _CharT()); }
306#if __cplusplus >= 201103L
308 shrink_to_fit()
noexcept
315 this->_M_invalidate_all();
330 this->_M_invalidate_all();
337 operator[](size_type __pos)
const _GLIBCXX_NOEXCEPT
339 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
340 _M_message(__gnu_debug::__msg_subscript_oob)
341 ._M_sequence(*
this,
"this")
342 ._M_integer(__pos,
"__pos")
343 ._M_integer(this->
size(),
"size"));
348 operator[](size_type __pos)
350#if __cplusplus < 201103L && defined(_GLIBCXX_DEBUG_PEDANTIC)
351 __glibcxx_check_subscript(__pos);
354 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
355 _M_message(__gnu_debug::__msg_subscript_oob)
356 ._M_sequence(*
this,
"this")
357 ._M_integer(__pos,
"__pos")
358 ._M_integer(this->
size(),
"size"));
365#if __cplusplus >= 201103L
375 this->_M_invalidate_all();
380 operator+=(
const _CharT* __s)
382 __glibcxx_check_string(__s);
384 this->_M_invalidate_all();
389 operator+=(_CharT __c)
392 this->_M_invalidate_all();
396#if __cplusplus >= 201103L
401 this->_M_invalidate_all();
410 this->_M_invalidate_all();
415 append(
const basic_string& __str, size_type __pos, size_type __n)
418 this->_M_invalidate_all();
423 append(
const _CharT* __s, size_type __n)
425 __glibcxx_check_string_len(__s, __n);
427 this->_M_invalidate_all();
432 append(
const _CharT* __s)
434 __glibcxx_check_string(__s);
436 this->_M_invalidate_all();
441 append(size_type __n, _CharT __c)
444 this->_M_invalidate_all();
448 template<
typename _InputIterator>
450 append(_InputIterator __first, _InputIterator __last)
453 __glibcxx_check_valid_range2(__first, __last, __dist);
455 if (__dist.
second >= __dp_sign)
457 __gnu_debug::__unsafe(__last));
461 this->_M_invalidate_all();
468 push_back(_CharT __c)
471 this->_M_invalidate_all();
478 this->_M_invalidate_all();
482#if __cplusplus >= 201103L
485 noexcept(
noexcept(std::declval<_Base&>().assign(
std::move(__x))))
488 this->_M_invalidate_all();
494 assign(
const basic_string& __str, size_type __pos, size_type __n)
497 this->_M_invalidate_all();
502 assign(
const _CharT* __s, size_type __n)
504 __glibcxx_check_string_len(__s, __n);
506 this->_M_invalidate_all();
511 assign(
const _CharT* __s)
513 __glibcxx_check_string(__s);
515 this->_M_invalidate_all();
520 assign(size_type __n, _CharT __c)
523 this->_M_invalidate_all();
527 template<
typename _InputIterator>
529 assign(_InputIterator __first, _InputIterator __last)
532 __glibcxx_check_valid_range2(__first, __last, __dist);
534 if (__dist.
second >= __dp_sign)
536 __gnu_debug::__unsafe(__last));
540 this->_M_invalidate_all();
544#if __cplusplus >= 201103L
549 this->_M_invalidate_all();
558 this->_M_invalidate_all();
564 size_type __pos2, size_type __n)
567 this->_M_invalidate_all();
572 insert(size_type __pos,
const _CharT* __s, size_type __n)
574 __glibcxx_check_string(__s);
576 this->_M_invalidate_all();
581 insert(size_type __pos,
const _CharT* __s)
583 __glibcxx_check_string(__s);
585 this->_M_invalidate_all();
590 insert(size_type __pos, size_type __n, _CharT __c)
593 this->_M_invalidate_all();
602 this->_M_invalidate_all();
606#if __cplusplus >= 201103L
611#if _GLIBCXX_USE_CXX11_ABI
616 typename _Base::iterator __res =
_Base::begin() + __offset;
618 this->_M_invalidate_all();
623 insert(
iterator __p, size_type __n, _CharT __c)
627 this->_M_invalidate_all();
631 template<
typename _InputIterator>
634 _InputIterator __first, _InputIterator __last)
639 typename _Base::iterator __res;
640#if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
643 if (__dist.
second >= __dp_sign)
645 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
647 __gnu_debug::__unsafe(__last));
651 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
655#if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
658 this->_M_invalidate_all();
662#if __cplusplus >= 201103L
667#if _GLIBCXX_USE_CXX11_ABI
674 this->_M_invalidate_all();
680 erase(size_type __pos = 0, size_type __n =
_Base::npos)
683 this->_M_invalidate_all();
692 this->_M_invalidate_all();
702 typename _Base::iterator __res =
_Base::erase(__first.base(),
704 this->_M_invalidate_all();
708#if __cplusplus >= 201103L
712 __glibcxx_check_nonempty();
714 this->_M_invalidate_all();
719 replace(size_type __pos1, size_type __n1,
const basic_string& __str)
722 this->_M_invalidate_all();
727 replace(size_type __pos1, size_type __n1,
const basic_string& __str,
728 size_type __pos2, size_type __n2)
731 this->_M_invalidate_all();
736 replace(size_type __pos, size_type __n1,
const _CharT* __s,
739 __glibcxx_check_string_len(__s, __n2);
741 this->_M_invalidate_all();
746 replace(size_type __pos, size_type __n1,
const _CharT* __s)
748 __glibcxx_check_string(__s);
750 this->_M_invalidate_all();
755 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
758 this->_M_invalidate_all();
768 this->_M_invalidate_all();
774 const _CharT* __s, size_type __n)
777 __glibcxx_check_string_len(__s, __n);
779 this->_M_invalidate_all();
788 __glibcxx_check_string(__s);
790 this->_M_invalidate_all();
796 size_type __n, _CharT __c)
800 this->_M_invalidate_all();
804 template<
typename _InputIterator>
807 _InputIterator __j1, _InputIterator __j2)
812 __glibcxx_check_valid_range2(__j1, __j2, __dist);
814 if (__dist.
second >= __dp_sign)
816 __gnu_debug::__unsafe(__j1),
817 __gnu_debug::__unsafe(__j2));
821 this->_M_invalidate_all();
825#if __cplusplus >= 201103L
832 this->_M_invalidate_all();
838 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const
840 __glibcxx_check_string_len(__s, __n);
846 _GLIBCXX_NOEXCEPT_IF(std::__is_nothrow_swappable<_Base>::value)
854 c_str()
const _GLIBCXX_NOEXCEPT
857 this->_M_invalidate_all();
862 data()
const _GLIBCXX_NOEXCEPT
865 this->_M_invalidate_all();
872 find(
const basic_string& __str, size_type __pos = 0)
const
877 find(
const _CharT* __s, size_type __pos, size_type __n)
const
879 __glibcxx_check_string(__s);
884 find(
const _CharT* __s, size_type __pos = 0)
const
886 __glibcxx_check_string(__s);
891 find(_CharT __c, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
900 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const
902 __glibcxx_check_string_len(__s, __n);
907 rfind(
const _CharT* __s, size_type __pos =
_Base::npos)
const
909 __glibcxx_check_string(__s);
914 rfind(_CharT __c, size_type __pos =
_Base::npos)
const _GLIBCXX_NOEXCEPT
918 find_first_of(
const basic_string& __str, size_type __pos = 0)
const
923 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const
925 __glibcxx_check_string(__s);
930 find_first_of(
const _CharT* __s, size_type __pos = 0)
const
932 __glibcxx_check_string(__s);
937 find_first_of(_CharT __c, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
942 size_type __pos =
_Base::npos)
const _GLIBCXX_NOEXCEPT
946 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const
948 __glibcxx_check_string(__s);
953 find_last_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
955 __glibcxx_check_string(__s);
960 find_last_of(_CharT __c, size_type __pos =
_Base::npos)
const
965 find_first_not_of(
const basic_string& __str, size_type __pos = 0)
const
970 find_first_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
972 __glibcxx_check_string_len(__s, __n);
977 find_first_not_of(
const _CharT* __s, size_type __pos = 0)
const
979 __glibcxx_check_string(__s);
984 find_first_not_of(_CharT __c, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
994 find_last_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
996 __glibcxx_check_string(__s);
1001 find_last_not_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
1003 __glibcxx_check_string(__s);
1008 find_last_not_of(_CharT __c, size_type __pos =
_Base::npos)
const
1013 substr(size_type __pos = 0, size_type __n =
_Base::npos)
const
1021 compare(size_type __pos1, size_type __n1,
1026 compare(size_type __pos1, size_type __n1,
const basic_string& __str,
1027 size_type __pos2, size_type __n2)
const
1031 compare(
const _CharT* __s)
const
1033 __glibcxx_check_string(__s);
1040 compare(size_type __pos1, size_type __n1,
const _CharT* __s)
const
1042 __glibcxx_check_string(__s);
1049 compare(size_type __pos1, size_type __n1,
const _CharT* __s,
1050 size_type __n2)
const
1052 __glibcxx_check_string_len(__s, __n2);
1057 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
1060 _M_base()
const _GLIBCXX_NOEXCEPT {
return *
this; }
1062 using _Safe::_M_invalidate_all;