133 basic_string<_CharT, _Traits, _Allocator>,
134 _Allocator, _Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>,
139 basic_string, _Allocator,
_Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>
142 template<
typename _ItT,
typename _SeqT,
typename _CatT>
143 friend class ::__gnu_debug::_Safe_iterator;
147 typename _Base::__const_iterator, basic_string> __const_iterator;
151 typedef _Traits traits_type;
152 typedef typename _Traits::char_type value_type;
153 typedef _Allocator allocator_type;
154 typedef typename _Base::size_type size_type;
155 typedef typename _Base::difference_type difference_type;
156 typedef typename _Base::reference reference;
157 typedef typename _Base::const_reference const_reference;
158 typedef typename _Base::pointer pointer;
159 typedef typename _Base::const_pointer const_pointer;
162 typename _Base::iterator, basic_string> iterator;
164 typename _Base::const_iterator, basic_string> const_iterator;
177#if __cplusplus < 201103L
190 const _Allocator& __a = _Allocator())
194 basic_string(
const basic_string& __s,
const _Allocator& __a)
195 : _Base(__s, __a) { }
217 basic_string(
const basic_string& __str, size_type __pos,
219 const _Allocator& __a = _Allocator())
220 : _Base(__str, __pos, __n, __a) { }
223 const _Allocator& __a = _Allocator())
224 : _Base(__glibcxx_check_string_n_constructor(__s, __n), __n, __a) { }
226 basic_string(
const _CharT* __s,
const _Allocator& __a = _Allocator())
227 : _Base(__glibcxx_check_string_constructor(__s), __a)
231 const _Allocator& __a = _Allocator())
232 : _Base(__n, __c, __a) { }
234#if __cplusplus >= 201103L
235 template<
typename _InputIterator,
236 typename = std::_RequireInputIter<_InputIterator>>
238 template<
typename _InputIterator>
240 basic_string(_InputIterator __begin, _InputIterator __end,
241 const _Allocator& __a = _Allocator())
243 __glibcxx_check_valid_constructor_range(__begin, __end)),
246#if __cplusplus >= 201103L
248 operator=(
const basic_string&) =
default;
251 operator=(basic_string&&) =
default;
255 operator=(
const _CharT* __s)
257 __glibcxx_check_string(__s);
259 this->_M_invalidate_all();
264 operator=(_CharT __c)
267 this->_M_invalidate_all();
271#if __cplusplus >= 201103L
276 this->_M_invalidate_all();
287 begin()
const _GLIBCXX_NOEXCEPT
295 end()
const _GLIBCXX_NOEXCEPT
296 {
return const_iterator(
_Base::end(),
this); }
300 {
return reverse_iterator(
end()); }
302 const_reverse_iterator
303 rbegin()
const _GLIBCXX_NOEXCEPT
304 {
return const_reverse_iterator(
end()); }
308 {
return reverse_iterator(
begin()); }
310 const_reverse_iterator
311 rend()
const _GLIBCXX_NOEXCEPT
312 {
return const_reverse_iterator(
begin()); }
314#if __cplusplus >= 201103L
320 cend()
const noexcept
321 {
return const_iterator(
_Base::end(),
this); }
323 const_reverse_iterator
325 {
return const_reverse_iterator(
end()); }
327 const_reverse_iterator
328 crend()
const noexcept
329 {
return const_reverse_iterator(
begin()); }
338 resize(size_type __n, _CharT __c)
341 this->_M_invalidate_all();
345 resize(size_type __n)
346 { this->resize(__n, _CharT()); }
348#if __cplusplus >= 201103L
357 this->_M_invalidate_all();
372 this->_M_invalidate_all();
379 operator[](size_type __pos)
const _GLIBCXX_NOEXCEPT
381 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
382 _M_message(__gnu_debug::__msg_subscript_oob)
383 ._M_sequence(*
this,
"this")
384 ._M_integer(__pos,
"__pos")
385 ._M_integer(this->
size(),
"size"));
390 operator[](size_type __pos)
392#if __cplusplus < 201103L && defined(_GLIBCXX_DEBUG_PEDANTIC)
393 __glibcxx_check_subscript(__pos);
396 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
397 _M_message(__gnu_debug::__msg_subscript_oob)
398 ._M_sequence(*
this,
"this")
399 ._M_integer(__pos,
"__pos")
400 ._M_integer(this->
size(),
"size"));
407#if __cplusplus >= 201103L
414 operator+=(
const basic_string& __str)
417 this->_M_invalidate_all();
422 operator+=(
const _CharT* __s)
424 __glibcxx_check_string(__s);
426 this->_M_invalidate_all();
431 operator+=(_CharT __c)
434 this->_M_invalidate_all();
438#if __cplusplus >= 201103L
443 this->_M_invalidate_all();
449 append(
const basic_string& __str)
452 this->_M_invalidate_all();
457 append(
const basic_string& __str, size_type __pos, size_type __n)
460 this->_M_invalidate_all();
465 append(
const _CharT* __s, size_type __n)
467 __glibcxx_check_string_len(__s, __n);
469 this->_M_invalidate_all();
474 append(
const _CharT* __s)
476 __glibcxx_check_string(__s);
478 this->_M_invalidate_all();
483 append(size_type __n, _CharT __c)
486 this->_M_invalidate_all();
490 template<
typename _InputIterator>
492 append(_InputIterator __first, _InputIterator __last)
494 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
495 __glibcxx_check_valid_range2(__first, __last, __dist);
497 if (__dist.second >= __dp_sign)
499 __gnu_debug::__unsafe(__last));
503 this->_M_invalidate_all();
510 push_back(_CharT __c)
513 this->_M_invalidate_all();
517 assign(
const basic_string& __x)
520 this->_M_invalidate_all();
524#if __cplusplus >= 201103L
526 assign(basic_string&& __x)
530 this->_M_invalidate_all();
536 assign(
const basic_string& __str, size_type __pos, size_type __n)
539 this->_M_invalidate_all();
544 assign(
const _CharT* __s, size_type __n)
546 __glibcxx_check_string_len(__s, __n);
548 this->_M_invalidate_all();
553 assign(
const _CharT* __s)
555 __glibcxx_check_string(__s);
557 this->_M_invalidate_all();
562 assign(size_type __n, _CharT __c)
565 this->_M_invalidate_all();
569 template<
typename _InputIterator>
571 assign(_InputIterator __first, _InputIterator __last)
573 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
574 __glibcxx_check_valid_range2(__first, __last, __dist);
576 if (__dist.second >= __dp_sign)
578 __gnu_debug::__unsafe(__last));
582 this->_M_invalidate_all();
586#if __cplusplus >= 201103L
591 this->_M_invalidate_all();
597 insert(size_type __pos1,
const basic_string& __str)
600 this->_M_invalidate_all();
605 insert(size_type __pos1,
const basic_string& __str,
606 size_type __pos2, size_type __n)
609 this->_M_invalidate_all();
614 insert(size_type __pos,
const _CharT* __s, size_type __n)
616 __glibcxx_check_string(__s);
618 this->_M_invalidate_all();
623 insert(size_type __pos,
const _CharT* __s)
625 __glibcxx_check_string(__s);
627 this->_M_invalidate_all();
632 insert(size_type __pos, size_type __n, _CharT __c)
635 this->_M_invalidate_all();
640 insert(__const_iterator __p, _CharT __c)
644 this->_M_invalidate_all();
645 return iterator(__res,
this);
648#if __cplusplus >= 201103L
650 insert(const_iterator __p, size_type __n, _CharT __c)
653#if _GLIBCXX_USE_CXX11_ABI
658 typename _Base::iterator __res =
_Base::begin() + __offset;
660 this->_M_invalidate_all();
661 return iterator(__res,
this);
665 insert(iterator __p, size_type __n, _CharT __c)
669 this->_M_invalidate_all();
673 template<
typename _InputIterator>
675 insert(__const_iterator __p,
676 _InputIterator __first, _InputIterator __last)
678 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
681 typename _Base::iterator __res;
682#if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
685 if (__dist.second >= __dp_sign)
687 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
689 __gnu_debug::__unsafe(__last));
693 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
697#if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
700 this->_M_invalidate_all();
701 return iterator(__res,
this);
704#if __cplusplus >= 201103L
709#if _GLIBCXX_USE_CXX11_ABI
716 this->_M_invalidate_all();
717 return iterator(__res,
this);
722 erase(size_type __pos = 0, size_type __n =
_Base::npos)
725 this->_M_invalidate_all();
730 erase(__const_iterator __position)
734 this->_M_invalidate_all();
735 return iterator(__res,
this);
739 erase(__const_iterator __first, __const_iterator __last)
744 typename _Base::iterator __res =
_Base::erase(__first.base(),
746 this->_M_invalidate_all();
747 return iterator(__res,
this);
750#if __cplusplus >= 201103L
754 __glibcxx_check_nonempty();
756 this->_M_invalidate_all();
761 replace(size_type __pos1, size_type __n1,
const basic_string& __str)
764 this->_M_invalidate_all();
769 replace(size_type __pos1, size_type __n1,
const basic_string& __str,
770 size_type __pos2, size_type __n2)
773 this->_M_invalidate_all();
778 replace(size_type __pos, size_type __n1,
const _CharT* __s,
781 __glibcxx_check_string_len(__s, __n2);
783 this->_M_invalidate_all();
788 replace(size_type __pos, size_type __n1,
const _CharT* __s)
790 __glibcxx_check_string(__s);
792 this->_M_invalidate_all();
797 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
800 this->_M_invalidate_all();
805 replace(__const_iterator __i1, __const_iterator __i2,
806 const basic_string& __str)
810 this->_M_invalidate_all();
815 replace(__const_iterator __i1, __const_iterator __i2,
816 const _CharT* __s, size_type __n)
819 __glibcxx_check_string_len(__s, __n);
821 this->_M_invalidate_all();
826 replace(__const_iterator __i1, __const_iterator __i2,
830 __glibcxx_check_string(__s);
832 this->_M_invalidate_all();
837 replace(__const_iterator __i1, __const_iterator __i2,
838 size_type __n, _CharT __c)
842 this->_M_invalidate_all();
846 template<
typename _InputIterator>
848 replace(__const_iterator __i1, __const_iterator __i2,
849 _InputIterator __j1, _InputIterator __j2)
853 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
854 __glibcxx_check_valid_range2(__j1, __j2, __dist);
856 if (__dist.second >= __dp_sign)
858 __gnu_debug::__unsafe(__j1),
859 __gnu_debug::__unsafe(__j2));
863 this->_M_invalidate_all();
867#if __cplusplus >= 201103L
869 replace(__const_iterator __i1, __const_iterator __i2,
874 this->_M_invalidate_all();
880 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const
882 __glibcxx_check_string_len(__s, __n);
887 swap(basic_string& __x)
888 _GLIBCXX_NOEXCEPT_IF(std::__is_nothrow_swappable<_Base>::value)
896 c_str()
const _GLIBCXX_NOEXCEPT
899 this->_M_invalidate_all();
904 data()
const _GLIBCXX_NOEXCEPT
907 this->_M_invalidate_all();
917 find(
const _CharT* __s, size_type __pos, size_type __n)
const
920 __glibcxx_check_string(__s);
926 find(
const _CharT* __s, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
928 __glibcxx_check_string(__s);
936 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const
938 __glibcxx_check_string_len(__s, __n);
944 rfind(
const _CharT* __s, size_type __pos =
_Base::npos)
const
946 __glibcxx_check_string(__s);
954 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const
957 __glibcxx_check_string(__s);
963 find_first_of(
const _CharT* __s, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
965 __glibcxx_check_string(__s);
973 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const
976 __glibcxx_check_string(__s);
982 find_last_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
985 __glibcxx_check_string(__s);
993 find_first_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
996 __glibcxx_check_string_len(__s, __n);
1000 _GLIBCXX20_CONSTEXPR
1002 find_first_not_of(
const _CharT* __s, size_type __pos = 0)
const
1005 __glibcxx_check_string(__s);
1011 _GLIBCXX20_CONSTEXPR
1013 find_last_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
1016 __glibcxx_check_string(__s);
1020 _GLIBCXX20_CONSTEXPR
1022 find_last_not_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
1025 __glibcxx_check_string(__s);
1030 substr(size_type __pos = 0, size_type __n =
_Base::npos)
const
1035 _GLIBCXX20_CONSTEXPR
1037 compare(
const _CharT* __s)
const _GLIBCXX_NOEXCEPT
1039 __glibcxx_check_string(__s);
1045 _GLIBCXX20_CONSTEXPR
1047 compare(size_type __pos1, size_type __n1,
const _CharT* __s)
const
1049 __glibcxx_check_string(__s);
1055 _GLIBCXX20_CONSTEXPR
1057 compare(size_type __pos1, size_type __n1,
const _CharT* __s,
1058 size_type __n2)
const
1060 __glibcxx_check_string_len(__s, __n2);
1065 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
1068 _M_base()
const _GLIBCXX_NOEXCEPT {
return *
this; }