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 template<
typename _InputIterator>
235 basic_string(_InputIterator __begin, _InputIterator __end,
236 const _Allocator& __a = _Allocator())
238 __glibcxx_check_valid_constructor_range(__begin, __end)),
241#if __cplusplus >= 201103L
243 operator=(
const basic_string&) =
default;
246 operator=(basic_string&&) =
default;
250 operator=(
const _CharT* __s)
252 __glibcxx_check_string(__s);
254 this->_M_invalidate_all();
259 operator=(_CharT __c)
262 this->_M_invalidate_all();
266#if __cplusplus >= 201103L
271 this->_M_invalidate_all();
282 begin()
const _GLIBCXX_NOEXCEPT
290 end()
const _GLIBCXX_NOEXCEPT
291 {
return const_iterator(
_Base::end(),
this); }
295 {
return reverse_iterator(
end()); }
297 const_reverse_iterator
298 rbegin()
const _GLIBCXX_NOEXCEPT
299 {
return const_reverse_iterator(
end()); }
303 {
return reverse_iterator(
begin()); }
305 const_reverse_iterator
306 rend()
const _GLIBCXX_NOEXCEPT
307 {
return const_reverse_iterator(
begin()); }
309#if __cplusplus >= 201103L
315 cend()
const noexcept
316 {
return const_iterator(
_Base::end(),
this); }
318 const_reverse_iterator
320 {
return const_reverse_iterator(
end()); }
322 const_reverse_iterator
323 crend()
const noexcept
324 {
return const_reverse_iterator(
begin()); }
333 resize(size_type __n, _CharT __c)
336 this->_M_invalidate_all();
340 resize(size_type __n)
341 { this->resize(__n, _CharT()); }
343#if __cplusplus >= 201103L
352 this->_M_invalidate_all();
367 this->_M_invalidate_all();
374 operator[](size_type __pos)
const _GLIBCXX_NOEXCEPT
376 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
377 _M_message(__gnu_debug::__msg_subscript_oob)
378 ._M_sequence(*
this,
"this")
379 ._M_integer(__pos,
"__pos")
380 ._M_integer(this->
size(),
"size"));
385 operator[](size_type __pos)
387#if __cplusplus < 201103L && defined(_GLIBCXX_DEBUG_PEDANTIC)
388 __glibcxx_check_subscript(__pos);
391 _GLIBCXX_DEBUG_VERIFY(__pos <= this->
size(),
392 _M_message(__gnu_debug::__msg_subscript_oob)
393 ._M_sequence(*
this,
"this")
394 ._M_integer(__pos,
"__pos")
395 ._M_integer(this->
size(),
"size"));
402#if __cplusplus >= 201103L
409 operator+=(
const basic_string& __str)
412 this->_M_invalidate_all();
417 operator+=(
const _CharT* __s)
419 __glibcxx_check_string(__s);
421 this->_M_invalidate_all();
426 operator+=(_CharT __c)
429 this->_M_invalidate_all();
433#if __cplusplus >= 201103L
438 this->_M_invalidate_all();
444 append(
const basic_string& __str)
447 this->_M_invalidate_all();
452 append(
const basic_string& __str, size_type __pos, size_type __n)
455 this->_M_invalidate_all();
460 append(
const _CharT* __s, size_type __n)
462 __glibcxx_check_string_len(__s, __n);
464 this->_M_invalidate_all();
469 append(
const _CharT* __s)
471 __glibcxx_check_string(__s);
473 this->_M_invalidate_all();
478 append(size_type __n, _CharT __c)
481 this->_M_invalidate_all();
485 template<
typename _InputIterator>
487 append(_InputIterator __first, _InputIterator __last)
489 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
490 __glibcxx_check_valid_range2(__first, __last, __dist);
492 if (__dist.second >= __dp_sign)
494 __gnu_debug::__unsafe(__last));
498 this->_M_invalidate_all();
505 push_back(_CharT __c)
508 this->_M_invalidate_all();
512 assign(
const basic_string& __x)
515 this->_M_invalidate_all();
519#if __cplusplus >= 201103L
521 assign(basic_string&& __x)
525 this->_M_invalidate_all();
531 assign(
const basic_string& __str, size_type __pos, size_type __n)
534 this->_M_invalidate_all();
539 assign(
const _CharT* __s, size_type __n)
541 __glibcxx_check_string_len(__s, __n);
543 this->_M_invalidate_all();
548 assign(
const _CharT* __s)
550 __glibcxx_check_string(__s);
552 this->_M_invalidate_all();
557 assign(size_type __n, _CharT __c)
560 this->_M_invalidate_all();
564 template<
typename _InputIterator>
566 assign(_InputIterator __first, _InputIterator __last)
568 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
569 __glibcxx_check_valid_range2(__first, __last, __dist);
571 if (__dist.second >= __dp_sign)
573 __gnu_debug::__unsafe(__last));
577 this->_M_invalidate_all();
581#if __cplusplus >= 201103L
586 this->_M_invalidate_all();
592 insert(size_type __pos1,
const basic_string& __str)
595 this->_M_invalidate_all();
600 insert(size_type __pos1,
const basic_string& __str,
601 size_type __pos2, size_type __n)
604 this->_M_invalidate_all();
609 insert(size_type __pos,
const _CharT* __s, size_type __n)
611 __glibcxx_check_string(__s);
613 this->_M_invalidate_all();
618 insert(size_type __pos,
const _CharT* __s)
620 __glibcxx_check_string(__s);
622 this->_M_invalidate_all();
627 insert(size_type __pos, size_type __n, _CharT __c)
630 this->_M_invalidate_all();
635 insert(__const_iterator __p, _CharT __c)
639 this->_M_invalidate_all();
640 return iterator(__res,
this);
643#if __cplusplus >= 201103L
645 insert(const_iterator __p, size_type __n, _CharT __c)
648#if _GLIBCXX_USE_CXX11_ABI
653 typename _Base::iterator __res =
_Base::begin() + __offset;
655 this->_M_invalidate_all();
656 return iterator(__res,
this);
660 insert(iterator __p, size_type __n, _CharT __c)
664 this->_M_invalidate_all();
668 template<
typename _InputIterator>
670 insert(__const_iterator __p,
671 _InputIterator __first, _InputIterator __last)
673 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
676 typename _Base::iterator __res;
677#if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
680 if (__dist.second >= __dp_sign)
682 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
684 __gnu_debug::__unsafe(__last));
688 _GLIBCXX_INSERT_RETURNS_ITERATOR_ONLY(__res =)
692#if ! _GLIBCXX_INSERT_RETURNS_ITERATOR
695 this->_M_invalidate_all();
696 return iterator(__res,
this);
699#if __cplusplus >= 201103L
704#if _GLIBCXX_USE_CXX11_ABI
711 this->_M_invalidate_all();
712 return iterator(__res,
this);
717 erase(size_type __pos = 0, size_type __n =
_Base::npos)
720 this->_M_invalidate_all();
725 erase(__const_iterator __position)
729 this->_M_invalidate_all();
730 return iterator(__res,
this);
734 erase(__const_iterator __first, __const_iterator __last)
739 typename _Base::iterator __res =
_Base::erase(__first.base(),
741 this->_M_invalidate_all();
742 return iterator(__res,
this);
745#if __cplusplus >= 201103L
749 __glibcxx_check_nonempty();
751 this->_M_invalidate_all();
756 replace(size_type __pos1, size_type __n1,
const basic_string& __str)
759 this->_M_invalidate_all();
764 replace(size_type __pos1, size_type __n1,
const basic_string& __str,
765 size_type __pos2, size_type __n2)
768 this->_M_invalidate_all();
773 replace(size_type __pos, size_type __n1,
const _CharT* __s,
776 __glibcxx_check_string_len(__s, __n2);
778 this->_M_invalidate_all();
783 replace(size_type __pos, size_type __n1,
const _CharT* __s)
785 __glibcxx_check_string(__s);
787 this->_M_invalidate_all();
792 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
795 this->_M_invalidate_all();
800 replace(__const_iterator __i1, __const_iterator __i2,
801 const basic_string& __str)
805 this->_M_invalidate_all();
810 replace(__const_iterator __i1, __const_iterator __i2,
811 const _CharT* __s, size_type __n)
814 __glibcxx_check_string_len(__s, __n);
816 this->_M_invalidate_all();
821 replace(__const_iterator __i1, __const_iterator __i2,
825 __glibcxx_check_string(__s);
827 this->_M_invalidate_all();
832 replace(__const_iterator __i1, __const_iterator __i2,
833 size_type __n, _CharT __c)
837 this->_M_invalidate_all();
841 template<
typename _InputIterator>
843 replace(__const_iterator __i1, __const_iterator __i2,
844 _InputIterator __j1, _InputIterator __j2)
848 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
849 __glibcxx_check_valid_range2(__j1, __j2, __dist);
851 if (__dist.second >= __dp_sign)
853 __gnu_debug::__unsafe(__j1),
854 __gnu_debug::__unsafe(__j2));
858 this->_M_invalidate_all();
862#if __cplusplus >= 201103L
864 replace(__const_iterator __i1, __const_iterator __i2,
869 this->_M_invalidate_all();
875 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const
877 __glibcxx_check_string_len(__s, __n);
882 swap(basic_string& __x)
883 _GLIBCXX_NOEXCEPT_IF(std::__is_nothrow_swappable<_Base>::value)
891 c_str()
const _GLIBCXX_NOEXCEPT
894 this->_M_invalidate_all();
899 data()
const _GLIBCXX_NOEXCEPT
902 this->_M_invalidate_all();
912 find(
const _CharT* __s, size_type __pos, size_type __n)
const
915 __glibcxx_check_string(__s);
921 find(
const _CharT* __s, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
923 __glibcxx_check_string(__s);
931 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const
933 __glibcxx_check_string_len(__s, __n);
939 rfind(
const _CharT* __s, size_type __pos =
_Base::npos)
const
941 __glibcxx_check_string(__s);
949 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const
952 __glibcxx_check_string(__s);
958 find_first_of(
const _CharT* __s, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
960 __glibcxx_check_string(__s);
968 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const
971 __glibcxx_check_string(__s);
977 find_last_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
980 __glibcxx_check_string(__s);
988 find_first_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
991 __glibcxx_check_string_len(__s, __n);
997 find_first_not_of(
const _CharT* __s, size_type __pos = 0)
const
1000 __glibcxx_check_string(__s);
1006 _GLIBCXX20_CONSTEXPR
1008 find_last_not_of(
const _CharT* __s, size_type __pos, size_type __n)
const
1011 __glibcxx_check_string(__s);
1015 _GLIBCXX20_CONSTEXPR
1017 find_last_not_of(
const _CharT* __s, size_type __pos =
_Base::npos)
const
1020 __glibcxx_check_string(__s);
1025 substr(size_type __pos = 0, size_type __n =
_Base::npos)
const
1030 _GLIBCXX20_CONSTEXPR
1032 compare(
const _CharT* __s)
const _GLIBCXX_NOEXCEPT
1034 __glibcxx_check_string(__s);
1040 _GLIBCXX20_CONSTEXPR
1042 compare(size_type __pos1, size_type __n1,
const _CharT* __s)
const
1044 __glibcxx_check_string(__s);
1050 _GLIBCXX20_CONSTEXPR
1052 compare(size_type __pos1, size_type __n1,
const _CharT* __s,
1053 size_type __n2)
const
1055 __glibcxx_check_string_len(__s, __n2);
1060 _M_base() _GLIBCXX_NOEXCEPT {
return *
this; }
1063 _M_base()
const _GLIBCXX_NOEXCEPT {
return *
this; }