96 basic_string<_CharT, _Traits, _Allocator>,
97 _Allocator, _Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>,
102 basic_string, _Allocator,
_Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>
105 template<
typename _ItT,
typename _SeqT,
typename _CatT>
106 friend class ::__gnu_debug::_Safe_iterator;
110 typename _Base::__const_iterator, basic_string> __const_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;
125 typename _Base::iterator, basic_string> iterator;
127 typename _Base::const_iterator, basic_string> const_iterator;
140#if __cplusplus < 201103L
153 const _Allocator& __a = _Allocator())
157 basic_string(
const basic_string& __s,
const _Allocator& __a)
158 : _Base(__s, __a) { }
180 basic_string(
const basic_string& __str, size_type __pos,
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
206 operator=(
const basic_string&) =
default;
209 operator=(basic_string&&) =
default;
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
254 {
return const_iterator(
_Base::end(),
this); }
258 {
return reverse_iterator(
end()); }
260 const_reverse_iterator
261 rbegin()
const _GLIBCXX_NOEXCEPT
262 {
return const_reverse_iterator(
end()); }
266 {
return reverse_iterator(
begin()); }
268 const_reverse_iterator
269 rend()
const _GLIBCXX_NOEXCEPT
270 {
return const_reverse_iterator(
begin()); }
272#if __cplusplus >= 201103L
278 cend()
const noexcept
279 {
return const_iterator(
_Base::end(),
this); }
281 const_reverse_iterator
283 {
return const_reverse_iterator(
end()); }
285 const_reverse_iterator
286 crend()
const noexcept
287 {
return const_reverse_iterator(
begin()); }
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
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
372 operator+=(
const basic_string& __str)
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();
407 append(
const basic_string& __str)
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)
452 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
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();
475 assign(
const basic_string& __x)
478 this->_M_invalidate_all();
482#if __cplusplus >= 201103L
484 assign(basic_string&& __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)
531 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
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();
555 insert(size_type __pos1,
const basic_string& __str)
558 this->_M_invalidate_all();
563 insert(size_type __pos1,
const basic_string& __str,
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();
598 insert(__const_iterator __p, _CharT __c)
602 this->_M_invalidate_all();
603 return iterator(__res,
this);
606#if __cplusplus >= 201103L
608 insert(const_iterator __p, size_type __n, _CharT __c)
611#if _GLIBCXX_USE_CXX11_ABI
616 typename _Base::iterator __res =
_Base::begin() + __offset;
618 this->_M_invalidate_all();
619 return iterator(__res,
this);
623 insert(iterator __p, size_type __n, _CharT __c)
627 this->_M_invalidate_all();
631 template<
typename _InputIterator>
633 insert(__const_iterator __p,
634 _InputIterator __first, _InputIterator __last)
636 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
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();
659 return iterator(__res,
this);
662#if __cplusplus >= 201103L
667#if _GLIBCXX_USE_CXX11_ABI
674 this->_M_invalidate_all();
675 return iterator(__res,
this);
680 erase(size_type __pos = 0, size_type __n =
_Base::npos)
683 this->_M_invalidate_all();
688 erase(__const_iterator __position)
692 this->_M_invalidate_all();
693 return iterator(__res,
this);
697 erase(__const_iterator __first, __const_iterator __last)
702 typename _Base::iterator __res =
_Base::erase(__first.base(),
704 this->_M_invalidate_all();
705 return iterator(__res,
this);
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();
763 replace(__const_iterator __i1, __const_iterator __i2,
764 const basic_string& __str)
768 this->_M_invalidate_all();
773 replace(__const_iterator __i1, __const_iterator __i2,
774 const _CharT* __s, size_type __n)
777 __glibcxx_check_string_len(__s, __n);
779 this->_M_invalidate_all();
784 replace(__const_iterator __i1, __const_iterator __i2,
788 __glibcxx_check_string(__s);
790 this->_M_invalidate_all();
795 replace(__const_iterator __i1, __const_iterator __i2,
796 size_type __n, _CharT __c)
800 this->_M_invalidate_all();
804 template<
typename _InputIterator>
806 replace(__const_iterator __i1, __const_iterator __i2,
807 _InputIterator __j1, _InputIterator __j2)
811 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
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
827 replace(__const_iterator __i1, __const_iterator __i2,
832 this->_M_invalidate_all();
838 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const
840 __glibcxx_check_string_len(__s, __n);
845 swap(basic_string& __x)
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
895 rfind(
const basic_string& __str, size_type __pos =
_Base::npos)
const
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
941 find_last_of(
const basic_string& __str,
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
988 find_last_not_of(
const basic_string& __str,
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
1017 compare(
const basic_string& __str)
const
1021 compare(size_type __pos1, size_type __n1,
1022 const basic_string& __str)
const
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; }