131 basic_string<_CharT, _Traits, _Allocator>,
132 _Allocator, _Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>,
137 basic_string, _Allocator,
_Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>
140 template<
typename _ItT,
typename _SeqT,
typename _CatT>
141 friend class ::__gnu_debug::_Safe_iterator;
145 typename _Base::__const_iterator, basic_string> __const_iterator;
149 typedef _Traits traits_type;
150 typedef typename _Traits::char_type value_type;
151 typedef _Allocator allocator_type;
152 typedef typename _Base::size_type size_type;
153 typedef typename _Base::difference_type difference_type;
154 typedef typename _Base::reference reference;
155 typedef typename _Base::const_reference const_reference;
156 typedef typename _Base::pointer pointer;
157 typedef typename _Base::const_pointer const_pointer;
160 typename _Base::iterator, basic_string> iterator;
162 typename _Base::const_iterator, basic_string> const_iterator;
175#if __cplusplus < 201103L
188 const _Allocator& __a = _Allocator())
192 basic_string(
const basic_string& __s,
const _Allocator& __a)
193 : _Base(__s, __a) { }
215 basic_string(
const basic_string& __str, size_type __pos,
217 const _Allocator& __a = _Allocator())
218 : _Base(__str, __pos, __n, __a) { }
221 const _Allocator& __a = _Allocator())
222 : _Base(__glibcxx_check_string_n_constructor(__s, __n), __n, __a) { }
224 basic_string(
const _CharT* __s,
const _Allocator& __a = _Allocator())
225 : _Base(__glibcxx_check_string_constructor(__s), __a)
229 const _Allocator& __a = _Allocator())
230 : _Base(__n, __c, __a) { }
232 template<
typename _InputIterator>
233 basic_string(_InputIterator __begin, _InputIterator __end,
234 const _Allocator& __a = _Allocator())
236 __glibcxx_check_valid_constructor_range(__begin, __end)),
239#if __cplusplus >= 201103L
241 operator=(
const basic_string&) =
default;
244 operator=(basic_string&&) =
default;
248 operator=(
const _CharT* __s)
250 __glibcxx_check_string(__s);
252 this->_M_invalidate_all();
257 operator=(_CharT __c)
260 this->_M_invalidate_all();
264#if __cplusplus >= 201103L
269 this->_M_invalidate_all();
280 begin()
const _GLIBCXX_NOEXCEPT
288 end()
const _GLIBCXX_NOEXCEPT
289 {
return const_iterator(
_Base::end(),
this); }
293 {
return reverse_iterator(
end()); }
295 const_reverse_iterator
296 rbegin()
const _GLIBCXX_NOEXCEPT
297 {
return const_reverse_iterator(
end()); }
301 {
return reverse_iterator(
begin()); }
303 const_reverse_iterator
304 rend()
const _GLIBCXX_NOEXCEPT
305 {
return const_reverse_iterator(
begin()); }
307#if __cplusplus >= 201103L
313 cend()
const noexcept
314 {
return const_iterator(
_Base::end(),
this); }
316 const_reverse_iterator
318 {
return const_reverse_iterator(
end()); }
320 const_reverse_iterator
321 crend()
const noexcept
322 {
return const_reverse_iterator(
begin()); }
331 resize(size_type __n, _CharT __c)
334 this->_M_invalidate_all();
338 resize(size_type __n)
339 { this->resize(__n, _CharT()); }
341#if __cplusplus >= 201103L
350 this->_M_invalidate_all();
365 this->_M_invalidate_all();
372 operator[](size_type __pos)
const _GLIBCXX_NOEXCEPT
374 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
375 _M_message(__gnu_debug::__msg_subscript_oob)
376 ._M_sequence(*
this,
"this")
377 ._M_integer(__pos,
"__pos")
378 ._M_integer(this->
size(),
"size"));
383 operator[](size_type __pos)
385#if __cplusplus < 201103L && defined(_GLIBCXX_DEBUG_PEDANTIC)
386 __glibcxx_check_subscript(__pos);
389 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
390 _M_message(__gnu_debug::__msg_subscript_oob)
391 ._M_sequence(*
this,
"this")
392 ._M_integer(__pos,
"__pos")
393 ._M_integer(this->
size(),
"size"));
400#if __cplusplus >= 201103L
407 operator+=(
const basic_string& __str)
410 this->_M_invalidate_all();
415 operator+=(
const _CharT* __s)
417 __glibcxx_check_string(__s);
419 this->_M_invalidate_all();
424 operator+=(_CharT __c)
427 this->_M_invalidate_all();
431#if __cplusplus >= 201103L
436 this->_M_invalidate_all();
442 append(
const basic_string& __str)
445 this->_M_invalidate_all();
450 append(
const basic_string& __str, size_type __pos, size_type __n)
453 this->_M_invalidate_all();
458 append(
const _CharT* __s, size_type __n)
460 __glibcxx_check_string_len(__s, __n);
462 this->_M_invalidate_all();
467 append(
const _CharT* __s)
469 __glibcxx_check_string(__s);
471 this->_M_invalidate_all();
476 append(size_type __n, _CharT __c)
479 this->_M_invalidate_all();
483 template<
typename _InputIterator>
485 append(_InputIterator __first, _InputIterator __last)
487 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
488 __glibcxx_check_valid_range2(__first, __last, __dist);
490 if (__dist.second >= __dp_sign)
492 __gnu_debug::__unsafe(__last));
496 this->_M_invalidate_all();
503 push_back(_CharT __c)
506 this->_M_invalidate_all();
510 assign(
const basic_string& __x)
513 this->_M_invalidate_all();
517#if __cplusplus >= 201103L
519 assign(basic_string&& __x)
523 this->_M_invalidate_all();
529 assign(
const basic_string& __str, size_type __pos, size_type __n)
532 this->_M_invalidate_all();
537 assign(
const _CharT* __s, size_type __n)
539 __glibcxx_check_string_len(__s, __n);
541 this->_M_invalidate_all();
546 assign(
const _CharT* __s)
548 __glibcxx_check_string(__s);
550 this->_M_invalidate_all();
555 assign(size_type __n, _CharT __c)
558 this->_M_invalidate_all();
562 template<
typename _InputIterator>
564 assign(_InputIterator __first, _InputIterator __last)
566 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
567 __glibcxx_check_valid_range2(__first, __last, __dist);
569 if (__dist.second >= __dp_sign)
571 __gnu_debug::__unsafe(__last));
575 this->_M_invalidate_all();
579#if __cplusplus >= 201103L
584 this->_M_invalidate_all();
590 insert(size_type __pos1,
const basic_string& __str)
593 this->_M_invalidate_all();
598 insert(size_type __pos1,
const basic_string& __str,
599 size_type __pos2, size_type __n)
602 this->_M_invalidate_all();
607 insert(size_type __pos,
const _CharT* __s, size_type __n)
609 __glibcxx_check_string(__s);
611 this->_M_invalidate_all();
616 insert(size_type __pos,
const _CharT* __s)
618 __glibcxx_check_string(__s);
620 this->_M_invalidate_all();
625 insert(size_type __pos, size_type __n, _CharT __c)
628 this->_M_invalidate_all();
633 insert(__const_iterator __p, _CharT __c)
637 this->_M_invalidate_all();
638 return iterator(__res,
this);
641#if __cplusplus >= 201103L
643 insert(const_iterator __p, size_type __n, _CharT __c)
646#if _GLIBCXX_USE_CXX11_ABI
651 typename _Base::iterator __res =
_Base::begin() + __offset;
653 this->_M_invalidate_all();
654 return iterator(__res,
this);
658 insert(iterator __p, size_type __n, _CharT __c)
662 this->_M_invalidate_all();
666 template<
typename _InputIterator>
668 insert(__const_iterator __p,
669 _InputIterator __first, _InputIterator __last)
671 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
674 typename _Base::iterator __res;
675#if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
678 if (__dist.second >= __dp_sign)
680 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
682 __gnu_debug::__unsafe(__last));
686 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
690#if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
693 this->_M_invalidate_all();
694 return iterator(__res,
this);
697#if __cplusplus >= 201103L
702#if _GLIBCXX_USE_CXX11_ABI
709 this->_M_invalidate_all();
710 return iterator(__res,
this);
715 erase(size_type __pos = 0, size_type __n =
_Base::npos)
718 this->_M_invalidate_all();
723 erase(__const_iterator __position)
727 this->_M_invalidate_all();
728 return iterator(__res,
this);
732 erase(__const_iterator __first, __const_iterator __last)
737 typename _Base::iterator __res =
_Base::erase(__first.base(),
739 this->_M_invalidate_all();
740 return iterator(__res,
this);
743#if __cplusplus >= 201103L
747 __glibcxx_check_nonempty();
749 this->_M_invalidate_all();
754 replace(size_type __pos1, size_type __n1,
const basic_string& __str)
757 this->_M_invalidate_all();
762 replace(size_type __pos1, size_type __n1,
const basic_string& __str,
763 size_type __pos2, size_type __n2)
766 this->_M_invalidate_all();
771 replace(size_type __pos, size_type __n1,
const _CharT* __s,
774 __glibcxx_check_string_len(__s, __n2);
776 this->_M_invalidate_all();
781 replace(size_type __pos, size_type __n1,
const _CharT* __s)
783 __glibcxx_check_string(__s);
785 this->_M_invalidate_all();
790 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
793 this->_M_invalidate_all();
798 replace(__const_iterator __i1, __const_iterator __i2,
799 const basic_string& __str)
803 this->_M_invalidate_all();
808 replace(__const_iterator __i1, __const_iterator __i2,
809 const _CharT* __s, size_type __n)
812 __glibcxx_check_string_len(__s, __n);
814 this->_M_invalidate_all();
819 replace(__const_iterator __i1, __const_iterator __i2,
823 __glibcxx_check_string(__s);
825 this->_M_invalidate_all();
830 replace(__const_iterator __i1, __const_iterator __i2,
831 size_type __n, _CharT __c)
835 this->_M_invalidate_all();
839 template<
typename _InputIterator>
841 replace(__const_iterator __i1, __const_iterator __i2,
842 _InputIterator __j1, _InputIterator __j2)
846 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
847 __glibcxx_check_valid_range2(__j1, __j2, __dist);
849 if (__dist.second >= __dp_sign)
851 __gnu_debug::__unsafe(__j1),
852 __gnu_debug::__unsafe(__j2));
856 this->_M_invalidate_all();
860#if __cplusplus >= 201103L
862 replace(__const_iterator __i1, __const_iterator __i2,
867 this->_M_invalidate_all();
873 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const
875 __glibcxx_check_string_len(__s, __n);
880 swap(basic_string& __x)
881 _GLIBCXX_NOEXCEPT_IF(std::__is_nothrow_swappable<_Base>::value)
889 c_str()
const _GLIBCXX_NOEXCEPT
892 this->_M_invalidate_all();
897 data()
const _GLIBCXX_NOEXCEPT
900 this->_M_invalidate_all();
910 find(
const _CharT* __s, size_type __pos, size_type __n)
const
913 __glibcxx_check_string(__s);
919 find(
const _CharT* __s, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
921 __glibcxx_check_string(__s);
929 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const
931 __glibcxx_check_string_len(__s, __n);
937 rfind(
const _CharT* __s, size_type __pos =
_Base::npos)
const
939 __glibcxx_check_string(__s);
947 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const
950 __glibcxx_check_string(__s);
956 find_first_of(
const _CharT* __s, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
958 __glibcxx_check_string(__s);
966 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const
969 __glibcxx_check_string(__s);
975 find_last_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
978 __glibcxx_check_string(__s);
986 find_first_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
989 __glibcxx_check_string_len(__s, __n);
995 find_first_not_of(
const _CharT* __s, size_type __pos = 0)
const
998 __glibcxx_check_string(__s);
1004 _GLIBCXX20_CONSTEXPR
1006 find_last_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
1009 __glibcxx_check_string(__s);
1013 _GLIBCXX20_CONSTEXPR
1015 find_last_not_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
1018 __glibcxx_check_string(__s);
1023 substr(size_type __pos = 0, size_type __n =
_Base::npos)
const
1028 _GLIBCXX20_CONSTEXPR
1030 compare(
const _CharT* __s)
const _GLIBCXX_NOEXCEPT
1032 __glibcxx_check_string(__s);
1038 _GLIBCXX20_CONSTEXPR
1040 compare(size_type __pos1, size_type __n1,
const _CharT* __s)
const
1042 __glibcxx_check_string(__s);
1048 _GLIBCXX20_CONSTEXPR
1050 compare(size_type __pos1, size_type __n1,
const _CharT* __s,
1051 size_type __n2)
const
1053 __glibcxx_check_string_len(__s, __n2);
1058 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
1061 _M_base()
const _GLIBCXX_NOEXCEPT {
return *
this; }