32 #pragma GCC system_header
34 #if __cplusplus >= 201103L
44 _GLIBCXX_BEGIN_NAMESPACE_VERSION
54 template<
typename _CharT,
typename _Traits,
typename _Alloc,
55 template <
typename,
typename,
typename>
class _Base>
57 :
private _Base<_CharT, _Traits, _Alloc>
59 typedef _Base<_CharT, _Traits, _Alloc> __vstring_base;
60 typedef typename __vstring_base::_CharT_alloc_type _CharT_alloc_type;
64 typedef _Traits traits_type;
65 typedef typename _Traits::char_type value_type;
66 typedef _Alloc allocator_type;
67 typedef typename _CharT_alloc_type::size_type size_type;
68 typedef typename _CharT_alloc_type::difference_type difference_type;
69 typedef value_type& reference;
70 typedef const value_type& const_reference;
71 typedef typename _CharT_alloc_type::pointer pointer;
72 typedef typename _CharT_alloc_type::const_pointer const_pointer;
73 typedef __gnu_cxx::__normal_iterator<pointer, __versa_string> iterator;
74 typedef __gnu_cxx::__normal_iterator<const_pointer, __versa_string>
76 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
77 typedef std::reverse_iterator<iterator> reverse_iterator;
81 static const size_type npos =
static_cast<size_type
>(-1);
85 _M_check(size_type __pos,
const char* __s)
const
87 if (__pos > this->size())
88 std::__throw_out_of_range(__N(__s));
93 _M_check_length(size_type __n1, size_type __n2,
const char* __s)
const
95 if (this->max_size() - (this->size() - __n1) < __n2)
96 std::__throw_length_error(__N(__s));
101 _M_limit(size_type __pos, size_type __off)
const
103 const bool __testoff = __off < this->size() - __pos;
104 return __testoff ? __off : this->size() - __pos;
109 _M_disjunct(
const _CharT* __s)
const
111 return (std::less<const _CharT*>()(__s, this->_M_data())
112 || std::less<const _CharT*>()(this->_M_data()
113 + this->size(), __s));
120 {
return iterator(this->_M_data()); }
124 {
return iterator(this->_M_data() + this->_M_length()); }
135 : __vstring_base() { }
142 : __vstring_base(__a) { }
150 : __vstring_base(__str) { }
152 #if __cplusplus >= 201103L
162 : __vstring_base(std::move(__str)) { }
170 const _Alloc& __a = _Alloc())
171 : __vstring_base(__l.begin(), __l.end(), __a) { }
181 size_type __n = npos)
182 : __vstring_base(__str._M_data()
183 + __str._M_check(__pos,
184 "__versa_string::__versa_string"),
185 __str._M_data() + __str._M_limit(__pos, __n)
186 + __pos, _Alloc()) { }
196 size_type __n,
const _Alloc& __a)
197 : __vstring_base(__str._M_data()
198 + __str._M_check(__pos,
199 "__versa_string::__versa_string"),
200 __str._M_data() + __str._M_limit(__pos, __n)
213 const _Alloc& __a = _Alloc())
214 : __vstring_base(__s, __s + __n, __a) { }
222 : __vstring_base(__s, __s ? __s + traits_type::length(__s) :
231 __versa_string(size_type __n, _CharT __c,
const _Alloc& __a = _Alloc())
232 : __vstring_base(__n, __c, __a) { }
240 #if __cplusplus >= 201103L
241 template<
class _InputIterator,
242 typename = std::_RequireInputIter<_InputIterator>>
244 template<
class _InputIterator>
247 const _Alloc& __a = _Alloc())
248 : __vstring_base(__beg, __end, __a) { }
253 ~__versa_string() _GLIBCXX_NOEXCEPT { }
260 operator=(
const __versa_string& __str)
261 {
return this->assign(__str); }
263 #if __cplusplus >= 201103L
272 operator=(__versa_string&& __str)
284 operator=(std::initializer_list<_CharT> __l)
286 this->assign(__l.begin(), __l.end());
296 operator=(
const _CharT* __s)
297 {
return this->assign(__s); }
307 operator=(_CharT __c)
309 this->assign(1, __c);
319 begin() _GLIBCXX_NOEXCEPT
322 return iterator(this->_M_data());
330 begin()
const _GLIBCXX_NOEXCEPT
331 {
return const_iterator(this->_M_data()); }
338 end() _GLIBCXX_NOEXCEPT
341 return iterator(this->_M_data() + this->size());
349 end()
const _GLIBCXX_NOEXCEPT
350 {
return const_iterator(this->_M_data() + this->size()); }
358 rbegin() _GLIBCXX_NOEXCEPT
359 {
return reverse_iterator(this->end()); }
366 const_reverse_iterator
367 rbegin()
const _GLIBCXX_NOEXCEPT
368 {
return const_reverse_iterator(this->end()); }
376 rend() _GLIBCXX_NOEXCEPT
377 {
return reverse_iterator(this->begin()); }
384 const_reverse_iterator
385 rend()
const _GLIBCXX_NOEXCEPT
386 {
return const_reverse_iterator(this->begin()); }
388 #if __cplusplus >= 201103L
394 cbegin()
const noexcept
395 {
return const_iterator(this->_M_data()); }
402 cend()
const noexcept
403 {
return const_iterator(this->_M_data() + this->size()); }
410 const_reverse_iterator
411 crbegin()
const noexcept
412 {
return const_reverse_iterator(this->end()); }
419 const_reverse_iterator
420 crend()
const noexcept
421 {
return const_reverse_iterator(this->begin()); }
429 size()
const _GLIBCXX_NOEXCEPT
430 {
return this->_M_length(); }
435 length()
const _GLIBCXX_NOEXCEPT
436 {
return this->_M_length(); }
440 max_size()
const _GLIBCXX_NOEXCEPT
441 {
return this->_M_max_size(); }
454 resize(size_type __n, _CharT __c);
467 resize(size_type __n)
468 { this->resize(__n, _CharT()); }
470 #if __cplusplus >= 201103L
475 if (capacity() > size())
478 { this->reserve(0); }
490 capacity()
const _GLIBCXX_NOEXCEPT
491 {
return this->_M_capacity(); }
511 reserve(size_type __res_arg = 0)
512 { this->_M_reserve(__res_arg); }
518 clear() _GLIBCXX_NOEXCEPT
519 { this->_M_clear(); }
526 empty()
const _GLIBCXX_NOEXCEPT
527 {
return this->size() == 0; }
541 operator[] (size_type __pos)
const
544 return this->_M_data()[__pos];
558 operator[](size_type __pos)
565 return this->_M_data()[__pos];
579 at(size_type __n)
const
581 if (__n >= this->size())
582 std::__throw_out_of_range(__N(
"__versa_string::at"));
583 return this->_M_data()[__n];
600 if (__n >= this->size())
601 std::__throw_out_of_range(__N(
"__versa_string::at"));
603 return this->_M_data()[__n];
606 #if __cplusplus >= 201103L
613 {
return operator[](0); }
621 {
return operator[](0); }
629 {
return operator[](this->size() - 1); }
637 {
return operator[](this->size() - 1); }
647 operator+=(
const __versa_string& __str)
648 {
return this->append(__str); }
656 operator+=(
const _CharT* __s)
657 {
return this->append(__s); }
665 operator+=(_CharT __c)
667 this->push_back(__c);
671 #if __cplusplus >= 201103L
678 operator+=(std::initializer_list<_CharT> __l)
679 {
return this->append(__l.begin(), __l.end()); }
688 append(
const __versa_string& __str)
689 {
return _M_append(__str._M_data(), __str.size()); }
705 append(
const __versa_string& __str, size_type __pos, size_type __n)
706 {
return _M_append(__str._M_data()
707 + __str._M_check(__pos,
"__versa_string::append"),
708 __str._M_limit(__pos, __n)); }
717 append(
const _CharT* __s, size_type __n)
720 _M_check_length(size_type(0), __n,
"__versa_string::append");
721 return _M_append(__s, __n);
730 append(
const _CharT* __s)
733 const size_type __n = traits_type::length(__s);
734 _M_check_length(size_type(0), __n,
"__versa_string::append");
735 return _M_append(__s, __n);
747 append(size_type __n, _CharT __c)
748 {
return _M_replace_aux(this->size(), size_type(0), __n, __c); }
750 #if __cplusplus >= 201103L
757 append(std::initializer_list<_CharT> __l)
758 {
return this->append(__l.begin(), __l.end()); }
769 #if __cplusplus >= 201103L
770 template<
class _InputIterator,
771 typename = std::_RequireInputIter<_InputIterator>>
773 template<
class _InputIterator>
776 append(_InputIterator __first, _InputIterator __last)
777 {
return this->replace(_M_iend(), _M_iend(), __first, __last); }
784 push_back(_CharT __c)
786 const size_type
__size = this->size();
787 if (__size + 1 > this->capacity() || this->_M_is_shared())
788 this->_M_mutate(__size, size_type(0), 0, size_type(1));
789 traits_type::assign(this->_M_data()[__size], __c);
790 this->_M_set_length(__size + 1);
799 assign(
const __versa_string& __str)
801 this->_M_assign(__str);
805 #if __cplusplus >= 201103L
815 assign(__versa_string&& __str)
836 assign(
const __versa_string& __str, size_type __pos, size_type __n)
837 {
return _M_replace(size_type(0), this->size(), __str._M_data()
838 + __str._M_check(__pos,
"__versa_string::assign"),
839 __str._M_limit(__pos, __n)); }
853 assign(
const _CharT* __s, size_type __n)
856 return _M_replace(size_type(0), this->size(), __s, __n);
869 assign(
const _CharT* __s)
872 return _M_replace(size_type(0), this->size(), __s,
873 traits_type::length(__s));
886 assign(size_type __n, _CharT __c)
887 {
return _M_replace_aux(size_type(0), this->size(), __n, __c); }
898 #if __cplusplus >= 201103L
899 template<
class _InputIterator,
900 typename = std::_RequireInputIter<_InputIterator>>
902 template<
class _InputIterator>
905 assign(_InputIterator __first, _InputIterator __last)
906 {
return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
908 #if __cplusplus >= 201103L
915 assign(std::initializer_list<_CharT> __l)
916 {
return this->assign(__l.begin(), __l.end()); }
933 insert(iterator __p, size_type __n, _CharT __c)
934 { this->replace(__p, __p, __n, __c); }
948 #if __cplusplus >= 201103L
949 template<
class _InputIterator,
950 typename = std::_RequireInputIter<_InputIterator>>
952 template<
class _InputIterator>
955 insert(iterator __p, _InputIterator __beg, _InputIterator __end)
956 { this->replace(__p, __p, __beg, __end); }
958 #if __cplusplus >= 201103L
966 insert(iterator __p, std::initializer_list<_CharT> __l)
967 { this->insert(__p, __l.begin(), __l.end()); }
983 insert(size_type __pos1,
const __versa_string& __str)
984 {
return this->replace(__pos1, size_type(0),
985 __str._M_data(), __str.size()); }
1006 insert(size_type __pos1,
const __versa_string& __str,
1007 size_type __pos2, size_type __n)
1008 {
return this->replace(__pos1, size_type(0), __str._M_data()
1009 + __str._M_check(__pos2,
"__versa_string::insert"),
1010 __str._M_limit(__pos2, __n)); }
1029 insert(size_type __pos,
const _CharT* __s, size_type __n)
1030 {
return this->replace(__pos, size_type(0), __s, __n); }
1048 insert(size_type __pos,
const _CharT* __s)
1051 return this->replace(__pos, size_type(0), __s,
1052 traits_type::length(__s));
1072 insert(size_type __pos, size_type __n, _CharT __c)
1073 {
return _M_replace_aux(_M_check(__pos,
"__versa_string::insert"),
1074 size_type(0), __n, __c); }
1090 insert(iterator __p, _CharT __c)
1093 const size_type __pos = __p - _M_ibegin();
1094 _M_replace_aux(__pos, size_type(0), size_type(1), __c);
1095 this->_M_set_leaked();
1096 return iterator(this->_M_data() + __pos);
1115 erase(size_type __pos = 0, size_type __n = npos)
1117 this->_M_erase(_M_check(__pos,
"__versa_string::erase"),
1118 _M_limit(__pos, __n));
1131 erase(iterator __position)
1134 && __position < _M_iend());
1135 const size_type __pos = __position - _M_ibegin();
1136 this->_M_erase(__pos, size_type(1));
1137 this->_M_set_leaked();
1138 return iterator(this->_M_data() + __pos);
1152 erase(iterator __first, iterator __last)
1155 && __last <= _M_iend());
1156 const size_type __pos = __first - _M_ibegin();
1157 this->_M_erase(__pos, __last - __first);
1158 this->_M_set_leaked();
1159 return iterator(this->_M_data() + __pos);
1162 #if __cplusplus >= 201103L
1170 { this->_M_erase(size()-1, 1); }
1191 replace(size_type __pos, size_type __n,
const __versa_string& __str)
1192 {
return this->replace(__pos, __n, __str._M_data(), __str.size()); }
1214 replace(size_type __pos1, size_type __n1,
const __versa_string& __str,
1215 size_type __pos2, size_type __n2)
1217 return this->replace(__pos1, __n1, __str._M_data()
1218 + __str._M_check(__pos2,
1219 "__versa_string::replace"),
1220 __str._M_limit(__pos2, __n2));
1242 replace(size_type __pos, size_type __n1,
const _CharT* __s,
1246 return _M_replace(_M_check(__pos,
"__versa_string::replace"),
1247 _M_limit(__pos, __n1), __s, __n2);
1266 replace(size_type __pos, size_type __n1,
const _CharT* __s)
1269 return this->replace(__pos, __n1, __s, traits_type::length(__s));
1290 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
1291 {
return _M_replace_aux(_M_check(__pos,
"__versa_string::replace"),
1292 _M_limit(__pos, __n1), __n2, __c); }
1308 replace(iterator __i1, iterator __i2,
const __versa_string& __str)
1309 {
return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
1326 replace(iterator __i1, iterator __i2,
const _CharT* __s, size_type __n)
1329 && __i2 <= _M_iend());
1330 return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
1347 replace(iterator __i1, iterator __i2,
const _CharT* __s)
1350 return this->replace(__i1, __i2, __s, traits_type::length(__s));
1368 replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
1371 && __i2 <= _M_iend());
1372 return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
1389 #if __cplusplus >= 201103L
1390 template<
class _InputIterator,
1391 typename = std::_RequireInputIter<_InputIterator>>
1393 replace(iterator __i1, iterator __i2,
1394 _InputIterator __k1, _InputIterator __k2)
1397 && __i2 <= _M_iend());
1399 return this->_M_replace_dispatch(__i1, __i2, __k1, __k2,
1400 std::__false_type());
1403 template<
class _InputIterator>
1405 replace(iterator __i1, iterator __i2,
1406 _InputIterator __k1, _InputIterator __k2)
1409 && __i2 <= _M_iend());
1411 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1412 return this->_M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
1419 replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
1422 && __i2 <= _M_iend());
1424 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
1429 replace(iterator __i1, iterator __i2,
1430 const _CharT* __k1,
const _CharT* __k2)
1433 && __i2 <= _M_iend());
1435 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
1440 replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
1443 && __i2 <= _M_iend());
1445 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
1446 __k1.base(), __k2 - __k1);
1450 replace(iterator __i1, iterator __i2,
1451 const_iterator __k1, const_iterator __k2)
1454 && __i2 <= _M_iend());
1456 return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
1457 __k1.base(), __k2 - __k1);
1460 #if __cplusplus >= 201103L
1474 __versa_string& replace(iterator __i1, iterator __i2,
1475 std::initializer_list<_CharT> __l)
1476 {
return this->replace(__i1, __i2, __l.begin(), __l.end()); }
1480 template<
class _Integer>
1482 _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
1483 _Integer __val, std::__true_type)
1484 {
return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
1486 template<
class _InputIterator>
1488 _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
1489 _InputIterator __k2, std::__false_type);
1492 _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
1496 _M_replace(size_type __pos, size_type __len1,
const _CharT* __s,
1497 const size_type __len2);
1500 _M_append(
const _CharT* __s, size_type __n);
1517 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const;
1527 swap(__versa_string& __s)
1528 { this->_M_swap(__s); }
1538 c_str()
const _GLIBCXX_NOEXCEPT
1539 {
return this->_M_data(); }
1548 data()
const _GLIBCXX_NOEXCEPT
1549 {
return this->_M_data(); }
1555 get_allocator()
const _GLIBCXX_NOEXCEPT
1556 {
return allocator_type(this->_M_get_allocator()); }
1571 find(
const _CharT* __s, size_type __pos, size_type __n)
const;
1584 find(
const __versa_string& __str, size_type __pos = 0)
const
1586 {
return this->find(__str.data(), __pos, __str.size()); }
1599 find(
const _CharT* __s, size_type __pos = 0)
const
1602 return this->find(__s, __pos, traits_type::length(__s));
1616 find(_CharT __c, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT;
1629 rfind(
const __versa_string& __str, size_type __pos = npos)
const
1631 {
return this->rfind(__str.data(), __pos, __str.size()); }
1646 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const;
1659 rfind(
const _CharT* __s, size_type __pos = npos)
const
1662 return this->rfind(__s, __pos, traits_type::length(__s));
1676 rfind(_CharT __c, size_type __pos = npos)
const _GLIBCXX_NOEXCEPT;
1689 find_first_of(
const __versa_string& __str, size_type __pos = 0)
const
1691 {
return this->find_first_of(__str.data(), __pos, __str.size()); }
1706 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const;
1719 find_first_of(
const _CharT* __s, size_type __pos = 0)
const
1722 return this->find_first_of(__s, __pos, traits_type::length(__s));
1738 find_first_of(_CharT __c, size_type __pos = 0)
const _GLIBCXX_NOEXCEPT
1739 {
return this->find(__c, __pos); }
1753 find_last_of(
const __versa_string& __str, size_type __pos = npos)
const
1755 {
return this->find_last_of(__str.data(), __pos, __str.size()); }
1770 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const;
1783 find_last_of(
const _CharT* __s, size_type __pos = npos)
const
1786 return this->find_last_of(__s, __pos, traits_type::length(__s));
1802 find_last_of(_CharT __c, size_type __pos = npos)
const _GLIBCXX_NOEXCEPT
1803 {
return this->rfind(__c, __pos); }
1816 find_first_not_of(
const __versa_string& __str, size_type __pos = 0)
const
1818 {
return this->find_first_not_of(__str.data(), __pos, __str.size()); }
1833 find_first_not_of(
const _CharT* __s, size_type __pos,
1834 size_type __n)
const;
1847 find_first_not_of(
const _CharT* __s, size_type __pos = 0)
const
1850 return this->find_first_not_of(__s, __pos, traits_type::length(__s));
1864 find_first_not_of(_CharT __c, size_type __pos = 0)
const
1879 find_last_not_of(
const __versa_string& __str,
1880 size_type __pos = npos)
const _GLIBCXX_NOEXCEPT
1881 {
return this->find_last_not_of(__str.data(), __pos, __str.size()); }
1896 find_last_not_of(
const _CharT* __s, size_type __pos,
1897 size_type __n)
const;
1910 find_last_not_of(
const _CharT* __s, size_type __pos = npos)
const
1913 return this->find_last_not_of(__s, __pos, traits_type::length(__s));
1927 find_last_not_of(_CharT __c, size_type __pos = npos)
const
1943 substr(size_type __pos = 0, size_type __n = npos)
const
1945 return __versa_string(*
this, _M_check(__pos,
"__versa_string::substr"),
1964 compare(
const __versa_string& __str)
const
1966 if (this->_M_compare(__str))
1969 const size_type
__size = this->size();
1970 const size_type __osize = __str.size();
1971 const size_type __len =
std::min(__size, __osize);
1973 int __r = traits_type::compare(this->_M_data(), __str.data(), __len);
1975 __r = this->_S_compare(__size, __osize);
1999 compare(size_type __pos, size_type __n,
2000 const __versa_string& __str)
const;
2026 compare(size_type __pos1, size_type __n1,
const __versa_string& __str,
2027 size_type __pos2, size_type __n2)
const;
2045 compare(
const _CharT* __s)
const;
2069 compare(size_type __pos, size_type __n1,
const _CharT* __s)
const;
2096 compare(size_type __pos, size_type __n1,
const _CharT* __s,
2097 size_type __n2)
const;
2107 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2108 template <
typename,
typename,
typename>
class _Base>
2119 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2120 template <
typename,
typename,
typename>
class _Base>
2131 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2132 template <
typename,
typename,
typename>
class _Base>
2143 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2144 template <
typename,
typename,
typename>
class _Base>
2147 const _CharT* __rhs);
2155 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2156 template <
typename,
typename,
typename>
class _Base>
2161 #if __cplusplus >= 201103L
2162 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2163 template <
typename,
typename,
typename>
class _Base>
2167 {
return std::move(__lhs.append(__rhs)); }
2169 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2170 template <
typename,
typename,
typename>
class _Base>
2174 {
return std::move(__rhs.insert(0, __lhs)); }
2176 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2177 template <
typename,
typename,
typename>
class _Base>
2182 const auto __size = __lhs.size() + __rhs.size();
2183 const bool __cond = (
__size > __lhs.capacity()
2184 &&
__size <= __rhs.capacity());
2185 return __cond ? std::move(__rhs.insert(0, __lhs))
2186 : std::move(__lhs.append(__rhs));
2189 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2190 template <
typename,
typename,
typename>
class _Base>
2194 {
return std::move(__rhs.insert(0, __lhs)); }
2196 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2197 template <
typename,
typename,
typename>
class _Base>
2201 {
return std::move(__rhs.insert(0, 1, __lhs)); }
2203 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2204 template <
typename,
typename,
typename>
class _Base>
2207 const _CharT* __rhs)
2208 {
return std::move(__lhs.append(__rhs)); }
2210 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2211 template <
typename,
typename,
typename>
class _Base>
2215 {
return std::move(__lhs.append(1, __rhs)); }
2225 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2226 template <
typename,
typename,
typename>
class _Base>
2230 {
return __lhs.compare(__rhs) == 0; }
2232 template<
typename _CharT,
2233 template <
typename,
typename,
typename>
class _Base>
2234 inline typename __enable_if<std::__is_char<_CharT>::__value,
bool>::__type
2236 std::allocator<_CharT>, _Base>& __lhs,
2238 std::allocator<_CharT>, _Base>& __rhs)
2239 {
return (__lhs.size() == __rhs.size()
2240 && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
2249 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2250 template <
typename,
typename,
typename>
class _Base>
2254 {
return __rhs.compare(__lhs) == 0; }
2262 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2263 template <
typename,
typename,
typename>
class _Base>
2266 const _CharT* __rhs)
2267 {
return __lhs.compare(__rhs) == 0; }
2276 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2277 template <
typename,
typename,
typename>
class _Base>
2281 {
return !(__lhs == __rhs); }
2289 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2290 template <
typename,
typename,
typename>
class _Base>
2294 {
return !(__lhs == __rhs); }
2302 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2303 template <
typename,
typename,
typename>
class _Base>
2306 const _CharT* __rhs)
2307 {
return !(__lhs == __rhs); }
2316 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2317 template <
typename,
typename,
typename>
class _Base>
2319 operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2321 {
return __lhs.compare(__rhs) < 0; }
2329 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2330 template <
typename,
typename,
typename>
class _Base>
2332 operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2333 const _CharT* __rhs)
2334 {
return __lhs.compare(__rhs) < 0; }
2342 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2343 template <
typename,
typename,
typename>
class _Base>
2347 {
return __rhs.compare(__lhs) > 0; }
2356 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2357 template <
typename,
typename,
typename>
class _Base>
2361 {
return __lhs.compare(__rhs) > 0; }
2369 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2370 template <
typename,
typename,
typename>
class _Base>
2373 const _CharT* __rhs)
2374 {
return __lhs.compare(__rhs) > 0; }
2382 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2383 template <
typename,
typename,
typename>
class _Base>
2387 {
return __rhs.compare(__lhs) < 0; }
2396 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2397 template <
typename,
typename,
typename>
class _Base>
2399 operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2401 {
return __lhs.compare(__rhs) <= 0; }
2409 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2410 template <
typename,
typename,
typename>
class _Base>
2412 operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2413 const _CharT* __rhs)
2414 {
return __lhs.compare(__rhs) <= 0; }
2422 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2423 template <
typename,
typename,
typename>
class _Base>
2427 {
return __rhs.compare(__lhs) >= 0; }
2436 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2437 template <
typename,
typename,
typename>
class _Base>
2441 {
return __lhs.compare(__rhs) >= 0; }
2449 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2450 template <
typename,
typename,
typename>
class _Base>
2453 const _CharT* __rhs)
2454 {
return __lhs.compare(__rhs) >= 0; }
2462 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2463 template <
typename,
typename,
typename>
class _Base>
2467 {
return __rhs.compare(__lhs) <= 0; }
2476 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2477 template <
typename,
typename,
typename>
class _Base>
2481 { __lhs.swap(__rhs); }
2483 _GLIBCXX_END_NAMESPACE_VERSION
2488 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2502 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2503 template <
typename,
typename,
typename>
class _Base>
2504 basic_istream<_CharT, _Traits>&
2505 operator>>(basic_istream<_CharT, _Traits>& __is,
2506 __gnu_cxx::__versa_string<_CharT, _Traits,
2507 _Alloc, _Base>& __str);
2518 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2519 template <
typename,
typename,
typename>
class _Base>
2520 inline basic_ostream<_CharT, _Traits>&
2521 operator<<(basic_ostream<_CharT, _Traits>& __os,
2522 const __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc,
2527 return __ostream_insert(__os, __str.data(), __str.size());
2544 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2545 template <
typename,
typename,
typename>
class _Base>
2546 basic_istream<_CharT, _Traits>&
2547 getline(basic_istream<_CharT, _Traits>& __is,
2548 __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>& __str,
2564 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2565 template <
typename,
typename,
typename>
class _Base>
2566 inline basic_istream<_CharT, _Traits>&
2567 getline(basic_istream<_CharT, _Traits>& __is,
2568 __gnu_cxx::__versa_string<_CharT, _Traits, _Alloc, _Base>& __str)
2569 {
return getline(__is, __str, __is.widen(
'\n')); }
2571 _GLIBCXX_END_NAMESPACE_VERSION
2574 #if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
2580 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2585 {
return __gnu_cxx::__stoa<long, int>(&std::strtol,
"stoi", __str.c_str(),
2590 {
return __gnu_cxx::__stoa(&std::strtol,
"stol", __str.c_str(),
2593 inline unsigned long
2595 {
return __gnu_cxx::__stoa(&std::strtoul,
"stoul", __str.c_str(),
2600 {
return __gnu_cxx::__stoa(&std::strtoll,
"stoll", __str.c_str(),
2603 inline unsigned long long
2605 {
return __gnu_cxx::__stoa(&std::strtoull,
"stoull", __str.c_str(),
2610 stof(
const __vstring& __str,
std::size_t* __idx = 0)
2611 {
return __gnu_cxx::__stoa(&std::strtof,
"stof", __str.c_str(), __idx); }
2614 stod(
const __vstring& __str,
std::size_t* __idx = 0)
2615 {
return __gnu_cxx::__stoa(&std::strtod,
"stod", __str.c_str(), __idx); }
2618 stold(
const __vstring& __str,
std::size_t* __idx = 0)
2619 {
return __gnu_cxx::__stoa(&std::strtold,
"stold", __str.c_str(), __idx); }
2625 to_string(
int __val)
2626 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, 4 *
sizeof(int),
2630 to_string(
unsigned __val)
2631 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2632 4 *
sizeof(unsigned),
2636 to_string(
long __val)
2637 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2642 to_string(
unsigned long __val)
2643 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2644 4 *
sizeof(
unsigned long),
2649 to_string(
long long __val)
2650 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2651 4 *
sizeof(
long long),
2655 to_string(
unsigned long long __val)
2656 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2657 4 *
sizeof(
unsigned long long),
2661 to_string(
float __val)
2663 const int __n = __numeric_traits<float>::__max_exponent10 + 20;
2664 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2669 to_string(
double __val)
2671 const int __n = __numeric_traits<double>::__max_exponent10 + 20;
2672 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2677 to_string(
long double __val)
2679 const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
2680 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2684 #ifdef _GLIBCXX_USE_WCHAR_T
2687 {
return __gnu_cxx::__stoa<long, int>(&std::wcstol,
"stoi", __str.c_str(),
2692 {
return __gnu_cxx::__stoa(&std::wcstol,
"stol", __str.c_str(),
2695 inline unsigned long
2697 {
return __gnu_cxx::__stoa(&std::wcstoul,
"stoul", __str.c_str(),
2702 {
return __gnu_cxx::__stoa(&std::wcstoll,
"stoll", __str.c_str(),
2705 inline unsigned long long
2707 {
return __gnu_cxx::__stoa(&std::wcstoull,
"stoull", __str.c_str(),
2712 stof(
const __wvstring& __str,
std::size_t* __idx = 0)
2713 {
return __gnu_cxx::__stoa(&std::wcstof,
"stof", __str.c_str(), __idx); }
2716 stod(
const __wvstring& __str,
std::size_t* __idx = 0)
2717 {
return __gnu_cxx::__stoa(&std::wcstod,
"stod", __str.c_str(), __idx); }
2720 stold(
const __wvstring& __str,
std::size_t* __idx = 0)
2721 {
return __gnu_cxx::__stoa(&std::wcstold,
"stold", __str.c_str(), __idx); }
2723 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
2726 to_wstring(
int __val)
2727 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2732 to_wstring(
unsigned __val)
2733 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2734 4 *
sizeof(unsigned),
2738 to_wstring(
long __val)
2739 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2744 to_wstring(
unsigned long __val)
2745 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2746 4 *
sizeof(
unsigned long),
2750 to_wstring(
long long __val)
2751 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2752 4 *
sizeof(
long long),
2756 to_wstring(
unsigned long long __val)
2757 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2758 4 *
sizeof(
unsigned long long),
2762 to_wstring(
float __val)
2764 const int __n = __numeric_traits<float>::__max_exponent10 + 20;
2765 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2770 to_wstring(
double __val)
2772 const int __n = __numeric_traits<double>::__max_exponent10 + 20;
2773 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2778 to_wstring(
long double __val)
2780 const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
2781 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2787 _GLIBCXX_END_NAMESPACE_VERSION
2792 #if __cplusplus >= 201103L
2798 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2802 struct hash<__gnu_cxx::__vstring>
2803 :
public __hash_base<size_t, __gnu_cxx::__vstring>
2806 operator()(
const __gnu_cxx::__vstring& __s)
const noexcept
2807 {
return std::_Hash_impl::hash(__s.data(), __s.length()); }
2810 #ifdef _GLIBCXX_USE_WCHAR_T
2813 struct hash<__gnu_cxx::__wvstring>
2814 :
public __hash_base<size_t, __gnu_cxx::__wvstring>
2817 operator()(
const __gnu_cxx::__wvstring& __s)
const noexcept
2818 {
return std::_Hash_impl::hash(__s.data(),
2819 __s.length() *
sizeof(
wchar_t)); }
2823 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
2826 struct hash<__gnu_cxx::__u16vstring>
2827 :
public __hash_base<size_t, __gnu_cxx::__u16vstring>
2830 operator()(
const __gnu_cxx::__u16vstring& __s)
const noexcept
2831 {
return std::_Hash_impl::hash(__s.data(),
2832 __s.length() *
sizeof(char16_t)); }
2837 struct hash<__gnu_cxx::__u32vstring>
2838 :
public __hash_base<size_t, __gnu_cxx::__u32vstring>
2841 operator()(
const __gnu_cxx::__u32vstring& __s)
const noexcept
2842 {
return std::_Hash_impl::hash(__s.data(),
2843 __s.length() *
sizeof(char32_t)); }
2847 _GLIBCXX_END_NAMESPACE_VERSION
bool operator>=(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:644
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Definition: functions.h:446
bool operator==(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))
std::size_t __size(__stack_t __stack)
Definition: profiler_node.h:68
#define __try
Definition: exception_defines.h:35
bool operator<=(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:580
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
#define __glibcxx_requires_string(_String)
Definition: debug.h:78
bool operator<(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:548
const _Tp & min(const _Tp &__a, const _Tp &__b)
Equivalent to std::min.
Definition: base.h:144
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, basic_string< _CharT, _Traits, _Allocator > &__str)
Definition: string:1122
#define __glibcxx_requires_string_len(_String, _Len)
Definition: debug.h:79
_Safe_iterator< _Iterator, _Sequence > operator+(typename _Safe_iterator< _Iterator, _Sequence >::difference_type __n, const _Safe_iterator< _Iterator, _Sequence > &__i)
Definition: safe_iterator.h:712
namespace std _GLIBCXX_VISIBILITY(default)
Definition: vstring.h:2486
bool operator>(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:612
#define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
Definition: debug.h:62
bool operator!=(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))
__WCHAR_TYPE__ wchar_t
Definition: stddef.h:324
__SIZE_TYPE__ size_t
Definition: stddef.h:212
std::basic_istream< _CharT, _Traits > & getline(std::basic_istream< _CharT, _Traits > &__is, basic_string< _CharT, _Traits, _Allocator > &__str, _CharT __delim)
Definition: string:1132
#define __catch(X)
Definition: exception_defines.h:36
#define __glibcxx_requires_valid_range(_First, _Last)
Definition: debug.h:65
void swap(exception_ptr &__lhs, exception_ptr &__rhs)
Definition: exception_ptr.h:160