32 #pragma GCC system_header
34 #if __cplusplus >= 201103L
42 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
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>
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
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
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) :
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) { }
261 {
return this->
assign(__str); }
263 #if __cplusplus >= 201103L
286 this->
assign(__l.begin(), __l.end());
297 {
return this->
assign(__s); }
322 return iterator(this->_M_data());
331 {
return const_iterator(this->_M_data()); }
341 return iterator(this->_M_data() + this->
size());
349 end() const _GLIBCXX_NOEXCEPT
350 {
return const_iterator(this->_M_data() + this->
size()); }
366 const_reverse_iterator
384 const_reverse_iterator
388 #if __cplusplus >= 201103L
395 {
return const_iterator(this->_M_data()); }
403 {
return const_iterator(this->_M_data() + this->
size()); }
410 const_reverse_iterator
419 const_reverse_iterator
430 {
return this->_M_length(); }
436 {
return this->_M_length(); }
441 {
return this->_M_max_size(); }
454 resize(size_type __n, _CharT __c);
468 { this->
resize(__n, _CharT()); }
470 #if __cplusplus >= 201103L
491 {
return this->_M_capacity(); }
512 { this->_M_reserve(__res_arg); }
519 { this->_M_clear(); }
527 {
return this->
size() == 0; }
543 _GLIBCXX_DEBUG_ASSERT(__pos <= this->
size());
544 return this->_M_data()[__pos];
561 _GLIBCXX_DEBUG_ASSERT(__pos <= this->
size());
563 _GLIBCXX_DEBUG_PEDASSERT(__pos < this->
size());
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
648 {
return this->
append(__str); }
657 {
return this->
append(__s); }
671 #if __cplusplus >= 201103L
679 {
return this->
append(__l.begin(), __l.end()); }
689 {
return _M_append(__str._M_data(), __str.
size()); }
706 {
return _M_append(__str._M_data()
707 + __str._M_check(__pos,
"__versa_string::append"),
708 __str._M_limit(__pos, __n)); }
719 __glibcxx_requires_string_len(__s, __n);
720 _M_check_length(size_type(0), __n,
"__versa_string::append");
721 return _M_append(__s, __n);
732 __glibcxx_requires_string(__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);
748 {
return _M_replace_aux(this->
size(), size_type(0), __n, __c); }
750 #if __cplusplus >= 201103L
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); }
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);
801 this->_M_assign(__str);
805 #if __cplusplus >= 201103L
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)); }
855 __glibcxx_requires_string_len(__s, __n);
856 return _M_replace(size_type(0), this->
size(), __s, __n);
871 __glibcxx_requires_string(__s);
872 return _M_replace(size_type(0), this->
size(), __s,
873 traits_type::length(__s));
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
916 {
return this->
assign(__l.begin(), __l.end()); }
919 #if __cplusplus >= 201103L
936 insert(const_iterator __p, size_type __n, _CharT __c)
938 _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
939 const size_type __pos = __p - _M_ibegin();
940 this->
replace(__p, __p, __n, __c);
941 return iterator(this->_M_data() + __pos);
959 { this->
replace(__p, __p, __n, __c); }
962 #if __cplusplus >= 201103L
977 template<
class _InputIterator,
978 typename = std::_RequireInputIter<_InputIterator>>
980 insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
982 _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
983 const size_type __pos = __p - _M_ibegin();
984 this->
replace(__p, __p, __beg, __end);
985 return iterator(this->_M_data() + __pos);
1000 template<
class _InputIterator>
1003 { this->
replace(__p, __p, __beg, __end); }
1006 #if __cplusplus >= 201103L
1017 {
return this->
insert(__p, __l.begin(), __l.end()); }
1034 {
return this->
replace(__pos1, size_type(0),
1035 __str._M_data(), __str.
size()); }
1057 size_type __pos2, size_type __n)
1058 {
return this->
replace(__pos1, size_type(0), __str._M_data()
1059 + __str._M_check(__pos2,
"__versa_string::insert"),
1060 __str._M_limit(__pos2, __n)); }
1079 insert(size_type __pos,
const _CharT* __s, size_type __n)
1080 {
return this->
replace(__pos, size_type(0), __s, __n); }
1100 __glibcxx_requires_string(__s);
1101 return this->
replace(__pos, size_type(0), __s,
1102 traits_type::length(__s));
1122 insert(size_type __pos, size_type __n, _CharT __c)
1123 {
return _M_replace_aux(_M_check(__pos,
"__versa_string::insert"),
1124 size_type(0), __n, __c); }
1140 #if __cplusplus >= 201103L
1143 insert(iterator __p, _CharT __c)
1146 _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
1147 const size_type __pos = __p - _M_ibegin();
1148 _M_replace_aux(__pos, size_type(0), size_type(1), __c);
1149 this->_M_set_leaked();
1150 return iterator(this->_M_data() + __pos);
1171 this->_M_erase(_M_check(__pos,
"__versa_string::erase"),
1172 _M_limit(__pos, __n));
1185 #if __cplusplus >= 201103L
1188 erase(iterator __position)
1191 _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
1192 && __position < _M_iend());
1193 const size_type __pos = __position - _M_ibegin();
1194 this->_M_erase(__pos, size_type(1));
1195 this->_M_set_leaked();
1196 return iterator(this->_M_data() + __pos);
1210 #if __cplusplus >= 201103L
1211 erase(const_iterator __first, const_iterator __last)
1213 erase(iterator __first, iterator __last)
1216 _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last
1217 && __last <= _M_iend());
1218 const size_type __pos = __first - _M_ibegin();
1219 this->_M_erase(__pos, __last - __first);
1220 this->_M_set_leaked();
1221 return iterator(this->_M_data() + __pos);
1224 #if __cplusplus >= 201103L
1232 { this->_M_erase(
size()-1, 1); }
1254 {
return this->
replace(__pos, __n, __str._M_data(), __str.
size()); }
1277 size_type __pos2, size_type __n2)
1279 return this->
replace(__pos1, __n1, __str._M_data()
1280 + __str._M_check(__pos2,
1281 "__versa_string::replace"),
1282 __str._M_limit(__pos2, __n2));
1304 replace(size_type __pos, size_type __n1,
const _CharT* __s,
1307 __glibcxx_requires_string_len(__s, __n2);
1308 return _M_replace(_M_check(__pos,
"__versa_string::replace"),
1309 _M_limit(__pos, __n1), __s, __n2);
1328 replace(size_type __pos, size_type __n1,
const _CharT* __s)
1330 __glibcxx_requires_string(__s);
1331 return this->
replace(__pos, __n1, __s, traits_type::length(__s));
1352 replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
1353 {
return _M_replace_aux(_M_check(__pos,
"__versa_string::replace"),
1354 _M_limit(__pos, __n1), __n2, __c); }
1370 #if __cplusplus >= 201103L
1376 {
return this->
replace(__i1, __i2, __str._M_data(), __str.
size()); }
1393 #if __cplusplus >= 201103L
1395 const _CharT* __s, size_type __n)
1397 replace(iterator __i1, iterator __i2,
const _CharT* __s, size_type __n)
1400 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1401 && __i2 <= _M_iend());
1402 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
1419 #if __cplusplus >= 201103L
1420 replace(const_iterator __i1, const_iterator __i2,
const _CharT* __s)
1422 replace(iterator __i1, iterator __i2,
const _CharT* __s)
1425 __glibcxx_requires_string(__s);
1426 return this->
replace(__i1, __i2, __s, traits_type::length(__s));
1444 #if __cplusplus >= 201103L
1445 replace(const_iterator __i1, const_iterator __i2, size_type __n,
1448 replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
1451 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1452 && __i2 <= _M_iend());
1453 return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
1470 #if __cplusplus >= 201103L
1471 template<
class _InputIterator,
1472 typename = std::_RequireInputIter<_InputIterator>>
1475 _InputIterator __k1, _InputIterator __k2)
1477 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1478 && __i2 <= _M_iend());
1479 __glibcxx_requires_valid_range(__k1, __k2);
1480 return this->_M_replace_dispatch(__i1, __i2, __k1, __k2,
1481 std::__false_type());
1484 template<
class _InputIterator>
1487 _InputIterator __k1, _InputIterator __k2)
1489 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1490 && __i2 <= _M_iend());
1491 __glibcxx_requires_valid_range(__k1, __k2);
1492 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1493 return this->_M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
1500 #if __cplusplus >= 201103L
1501 replace(const_iterator __i1, const_iterator __i2,
1502 _CharT* __k1, _CharT* __k2)
1504 replace(iterator __i1, iterator __i2,
1505 _CharT* __k1, _CharT* __k2)
1508 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1509 && __i2 <= _M_iend());
1510 __glibcxx_requires_valid_range(__k1, __k2);
1511 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1,
1516 #if __cplusplus >= 201103L
1517 replace(const_iterator __i1, const_iterator __i2,
1518 const _CharT* __k1,
const _CharT* __k2)
1520 replace(iterator __i1, iterator __i2,
1521 const _CharT* __k1,
const _CharT* __k2)
1524 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1525 && __i2 <= _M_iend());
1526 __glibcxx_requires_valid_range(__k1, __k2);
1527 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1,
1532 #if __cplusplus >= 201103L
1533 replace(const_iterator __i1, const_iterator __i2,
1534 iterator __k1, iterator __k2)
1536 replace(iterator __i1, iterator __i2,
1537 iterator __k1, iterator __k2)
1540 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1541 && __i2 <= _M_iend());
1542 __glibcxx_requires_valid_range(__k1, __k2);
1543 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1,
1544 __k1.base(), __k2 - __k1);
1548 #if __cplusplus >= 201103L
1549 replace(const_iterator __i1, const_iterator __i2,
1550 const_iterator __k1, const_iterator __k2)
1552 replace(iterator __i1, iterator __i2,
1553 const_iterator __k1, const_iterator __k2)
1556 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
1557 && __i2 <= _M_iend());
1558 __glibcxx_requires_valid_range(__k1, __k2);
1559 return this->
replace(__i1 - _M_ibegin(), __i2 - __i1,
1560 __k1.base(), __k2 - __k1);
1563 #if __cplusplus >= 201103L
1580 {
return this->
replace(__i1, __i2, __l.begin(), __l.end()); }
1584 template<
class _Integer>
1586 _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
1587 _Integer __n, _Integer __val, std::__true_type)
1588 {
return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
1590 template<
class _InputIterator>
1592 _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
1593 _InputIterator __k1, _InputIterator __k2,
1597 _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
1601 _M_replace(size_type __pos, size_type __len1,
const _CharT* __s,
1602 const size_type __len2);
1605 _M_append(
const _CharT* __s, size_type __n);
1622 copy(_CharT* __s, size_type __n, size_type __pos = 0)
const;
1633 { this->_M_swap(__s); }
1644 {
return this->_M_data(); }
1654 {
return this->_M_data(); }
1661 {
return allocator_type(this->_M_get_allocator()); }
1676 find(
const _CharT* __s, size_type __pos, size_type __n)
const;
1691 {
return this->
find(__str.
data(), __pos, __str.
size()); }
1704 find(
const _CharT* __s, size_type __pos = 0)
const
1706 __glibcxx_requires_string(__s);
1707 return this->
find(__s, __pos, traits_type::length(__s));
1721 find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT;
1736 {
return this->
rfind(__str.data(), __pos, __str.size()); }
1751 rfind(
const _CharT* __s, size_type __pos, size_type __n)
const;
1766 __glibcxx_requires_string(__s);
1767 return this->
rfind(__s, __pos, traits_type::length(__s));
1781 rfind(_CharT __c, size_type __pos =
npos) const _GLIBCXX_NOEXCEPT;
1796 {
return this->
find_first_of(__str.data(), __pos, __str.size()); }
1811 find_first_of(
const _CharT* __s, size_type __pos, size_type __n)
const;
1826 __glibcxx_requires_string(__s);
1827 return this->
find_first_of(__s, __pos, traits_type::length(__s));
1844 {
return this->
find(__c, __pos); }
1875 find_last_of(
const _CharT* __s, size_type __pos, size_type __n)
const;
1890 __glibcxx_requires_string(__s);
1891 return this->
find_last_of(__s, __pos, traits_type::length(__s));
1908 {
return this->
rfind(__c, __pos); }
1939 size_type __n)
const;
1954 __glibcxx_requires_string(__s);
1985 size_type __pos =
npos) const _GLIBCXX_NOEXCEPT
2002 size_type __n)
const;
2017 __glibcxx_requires_string(__s);
2050 return __versa_string(*
this, _M_check(__pos,
"__versa_string::substr"),
2071 if (this->_M_compare(__str))
2074 const size_type __size = this->
size();
2075 const size_type __osize = __str.
size();
2076 const size_type __len =
std::min(__size, __osize);
2078 int __r = traits_type::compare(this->_M_data(), __str.
data(), __len);
2080 __r = this->_S_compare(__size, __osize);
2104 compare(size_type __pos, size_type __n,
2132 size_type __pos2, size_type __n2)
const;
2150 compare(
const _CharT* __s)
const;
2174 compare(size_type __pos, size_type __n1,
const _CharT* __s)
const;
2201 compare(size_type __pos, size_type __n1,
const _CharT* __s,
2202 size_type __n2)
const;
2212 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2213 template <
typename,
typename,
typename>
class _Base>
2214 __versa_string<_CharT, _Traits, _Alloc, _Base>
2215 operator+(
const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2216 const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
2224 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2225 template <
typename,
typename,
typename>
class _Base>
2226 __versa_string<_CharT, _Traits, _Alloc, _Base>
2227 operator+(
const _CharT* __lhs,
2228 const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
2236 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2237 template <
typename,
typename,
typename>
class _Base>
2238 __versa_string<_CharT, _Traits, _Alloc, _Base>
2239 operator+(_CharT __lhs,
2240 const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs);
2248 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2249 template <
typename,
typename,
typename>
class _Base>
2250 __versa_string<_CharT, _Traits, _Alloc, _Base>
2251 operator+(
const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2252 const _CharT* __rhs);
2260 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2261 template <
typename,
typename,
typename>
class _Base>
2262 __versa_string<_CharT, _Traits, _Alloc, _Base>
2263 operator+(
const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2266 #if __cplusplus >= 201103L
2267 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2268 template <
typename,
typename,
typename>
class _Base>
2269 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2270 operator+(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
2271 const __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
2272 {
return std::move(__lhs.append(__rhs)); }
2274 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2275 template <
typename,
typename,
typename>
class _Base>
2276 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2277 operator+(
const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2278 __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
2279 {
return std::move(__rhs.insert(0, __lhs)); }
2281 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2282 template <
typename,
typename,
typename>
class _Base>
2283 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2284 operator+(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
2285 __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
2287 const auto __size = __lhs.size() + __rhs.size();
2288 const bool __cond = (__size > __lhs.capacity()
2289 && __size <= __rhs.capacity());
2290 return __cond ? std::move(__rhs.insert(0, __lhs))
2291 : std::move(__lhs.append(__rhs));
2294 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2295 template <
typename,
typename,
typename>
class _Base>
2296 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2297 operator+(
const _CharT* __lhs,
2298 __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
2299 {
return std::move(__rhs.insert(0, __lhs)); }
2301 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2302 template <
typename,
typename,
typename>
class _Base>
2303 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2304 operator+(_CharT __lhs,
2305 __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
2306 {
return std::move(__rhs.insert(0, 1, __lhs)); }
2308 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2309 template <
typename,
typename,
typename>
class _Base>
2310 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2311 operator+(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
2312 const _CharT* __rhs)
2313 {
return std::move(__lhs.append(__rhs)); }
2315 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2316 template <
typename,
typename,
typename>
class _Base>
2317 inline __versa_string<_CharT, _Traits, _Alloc, _Base>
2318 operator+(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
2320 {
return std::move(__lhs.append(1, __rhs)); }
2330 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2331 template <
typename,
typename,
typename>
class _Base>
2335 {
return __lhs.
compare(__rhs) == 0; }
2337 template<
typename _CharT,
2338 template <
typename,
typename,
typename>
class _Base>
2339 inline typename __enable_if<std::__is_char<_CharT>::__value,
bool>::__type
2344 {
return (__lhs.size() == __rhs.size()
2354 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2355 template <
typename,
typename,
typename>
class _Base>
2357 operator==(
const _CharT* __lhs,
2359 {
return __rhs.
compare(__lhs) == 0; }
2367 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2368 template <
typename,
typename,
typename>
class _Base>
2371 const _CharT* __rhs)
2372 {
return __lhs.
compare(__rhs) == 0; }
2381 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2382 template <
typename,
typename,
typename>
class _Base>
2386 {
return !(__lhs == __rhs); }
2394 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2395 template <
typename,
typename,
typename>
class _Base>
2397 operator!=(
const _CharT* __lhs,
2399 {
return !(__lhs == __rhs); }
2407 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2408 template <
typename,
typename,
typename>
class _Base>
2411 const _CharT* __rhs)
2412 {
return !(__lhs == __rhs); }
2421 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2422 template <
typename,
typename,
typename>
class _Base>
2424 operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2426 {
return __lhs.
compare(__rhs) < 0; }
2434 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2435 template <
typename,
typename,
typename>
class _Base>
2437 operator<(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2438 const _CharT* __rhs)
2439 {
return __lhs.compare(__rhs) < 0; }
2447 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2448 template <
typename,
typename,
typename>
class _Base>
2450 operator<(
const _CharT* __lhs,
2452 {
return __rhs.
compare(__lhs) > 0; }
2461 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2462 template <
typename,
typename,
typename>
class _Base>
2466 {
return __lhs.
compare(__rhs) > 0; }
2474 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2475 template <
typename,
typename,
typename>
class _Base>
2478 const _CharT* __rhs)
2479 {
return __lhs.
compare(__rhs) > 0; }
2487 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2488 template <
typename,
typename,
typename>
class _Base>
2490 operator>(
const _CharT* __lhs,
2492 {
return __rhs.
compare(__lhs) < 0; }
2501 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2502 template <
typename,
typename,
typename>
class _Base>
2504 operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2506 {
return __lhs.
compare(__rhs) <= 0; }
2514 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2515 template <
typename,
typename,
typename>
class _Base>
2517 operator<=(const __versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
2518 const _CharT* __rhs)
2519 {
return __lhs.compare(__rhs) <= 0; }
2527 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2528 template <
typename,
typename,
typename>
class _Base>
2530 operator<=(
const _CharT* __lhs,
2532 {
return __rhs.
compare(__lhs) >= 0; }
2541 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2542 template <
typename,
typename,
typename>
class _Base>
2546 {
return __lhs.
compare(__rhs) >= 0; }
2554 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2555 template <
typename,
typename,
typename>
class _Base>
2558 const _CharT* __rhs)
2559 {
return __lhs.
compare(__rhs) >= 0; }
2567 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2568 template <
typename,
typename,
typename>
class _Base>
2570 operator>=(
const _CharT* __lhs,
2572 {
return __rhs.
compare(__lhs) <= 0; }
2581 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2582 template <
typename,
typename,
typename>
class _Base>
2586 { __lhs.
swap(__rhs); }
2588 _GLIBCXX_END_NAMESPACE_VERSION
2591 namespace std _GLIBCXX_VISIBILITY(default)
2593 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2607 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2608 template <
typename,
typename,
typename>
class _Base>
2609 basic_istream<_CharT, _Traits>&
2610 operator>>(basic_istream<_CharT, _Traits>& __is,
2612 _Alloc, _Base>& __str);
2623 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2624 template <
typename,
typename,
typename>
class _Base>
2625 inline basic_ostream<_CharT, _Traits>&
2626 operator<<(basic_ostream<_CharT, _Traits>& __os,
2632 return __ostream_insert(__os, __str.
data(), __str.
size());
2649 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2650 template <
typename,
typename,
typename>
class _Base>
2651 basic_istream<_CharT, _Traits>&
2652 getline(basic_istream<_CharT, _Traits>& __is,
2669 template<
typename _CharT,
typename _Traits,
typename _Alloc,
2670 template <
typename,
typename,
typename>
class _Base>
2671 inline basic_istream<_CharT, _Traits>&
2676 _GLIBCXX_END_NAMESPACE_VERSION
2679 #if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
2683 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
2685 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2689 stoi(
const __vstring& __str, std::size_t* __idx = 0,
int __base = 10)
2690 {
return __gnu_cxx::__stoa<long, int>(&std::strtol,
"stoi", __str.c_str(),
2694 stol(
const __vstring& __str, std::size_t* __idx = 0,
int __base = 10)
2695 {
return __gnu_cxx::__stoa(&std::strtol,
"stol", __str.c_str(),
2698 inline unsigned long
2699 stoul(
const __vstring& __str, std::size_t* __idx = 0,
int __base = 10)
2700 {
return __gnu_cxx::__stoa(&std::strtoul,
"stoul", __str.c_str(),
2704 stoll(
const __vstring& __str, std::size_t* __idx = 0,
int __base = 10)
2705 {
return __gnu_cxx::__stoa(&std::strtoll,
"stoll", __str.c_str(),
2708 inline unsigned long long
2709 stoull(
const __vstring& __str, std::size_t* __idx,
int __base = 10)
2710 {
return __gnu_cxx::__stoa(&std::strtoull,
"stoull", __str.c_str(),
2715 stof(
const __vstring& __str, std::size_t* __idx = 0)
2716 {
return __gnu_cxx::__stoa(&std::strtof,
"stof", __str.c_str(), __idx); }
2719 stod(
const __vstring& __str, std::size_t* __idx = 0)
2720 {
return __gnu_cxx::__stoa(&std::strtod,
"stod", __str.c_str(), __idx); }
2723 stold(
const __vstring& __str, std::size_t* __idx = 0)
2724 {
return __gnu_cxx::__stoa(&std::strtold,
"stold", __str.c_str(), __idx); }
2731 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, 4 *
sizeof(int),
2736 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2737 4 *
sizeof(unsigned),
2742 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2748 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2749 4 *
sizeof(
unsigned long),
2755 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2756 4 *
sizeof(
long long),
2761 {
return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf,
2762 4 *
sizeof(
unsigned long long),
2768 const int __n = __numeric_traits<float>::__max_exponent10 + 20;
2769 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2776 const int __n = __numeric_traits<double>::__max_exponent10 + 20;
2777 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2784 const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
2785 return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
2789 #ifdef _GLIBCXX_USE_WCHAR_T
2791 stoi(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2792 {
return __gnu_cxx::__stoa<long, int>(&std::wcstol,
"stoi", __str.c_str(),
2796 stol(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2797 {
return __gnu_cxx::__stoa(&std::wcstol,
"stol", __str.c_str(),
2800 inline unsigned long
2801 stoul(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2802 {
return __gnu_cxx::__stoa(&std::wcstoul,
"stoul", __str.c_str(),
2806 stoll(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2807 {
return __gnu_cxx::__stoa(&std::wcstoll,
"stoll", __str.c_str(),
2810 inline unsigned long long
2811 stoull(
const __wvstring& __str, std::size_t* __idx = 0,
int __base = 10)
2812 {
return __gnu_cxx::__stoa(&std::wcstoull,
"stoull", __str.c_str(),
2817 stof(
const __wvstring& __str, std::size_t* __idx = 0)
2818 {
return __gnu_cxx::__stoa(&std::wcstof,
"stof", __str.c_str(), __idx); }
2821 stod(
const __wvstring& __str, std::size_t* __idx = 0)
2822 {
return __gnu_cxx::__stoa(&std::wcstod,
"stod", __str.c_str(), __idx); }
2825 stold(
const __wvstring& __str, std::size_t* __idx = 0)
2826 {
return __gnu_cxx::__stoa(&std::wcstold,
"stold", __str.c_str(), __idx); }
2828 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
2831 to_wstring(
int __val)
2832 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2837 to_wstring(
unsigned __val)
2838 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2839 4 *
sizeof(unsigned),
2843 to_wstring(
long __val)
2844 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2849 to_wstring(
unsigned long __val)
2850 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2851 4 *
sizeof(
unsigned long),
2855 to_wstring(
long long __val)
2856 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2857 4 *
sizeof(
long long),
2861 to_wstring(
unsigned long long __val)
2862 {
return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf,
2863 4 *
sizeof(
unsigned long long),
2867 to_wstring(
float __val)
2869 const int __n = __numeric_traits<float>::__max_exponent10 + 20;
2870 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2875 to_wstring(
double __val)
2877 const int __n = __numeric_traits<double>::__max_exponent10 + 20;
2878 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2883 to_wstring(
long double __val)
2885 const int __n = __numeric_traits<long double>::__max_exponent10 + 20;
2886 return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
2892 _GLIBCXX_END_NAMESPACE_VERSION
2897 #if __cplusplus >= 201103L
2901 namespace std _GLIBCXX_VISIBILITY(default)
2903 _GLIBCXX_BEGIN_NAMESPACE_VERSION
2908 :
public __hash_base<size_t, __gnu_cxx::__vstring>
2912 {
return std::_Hash_impl::hash(__s.
data(), __s.
length()); }
2915 #ifdef _GLIBCXX_USE_WCHAR_T
2919 :
public __hash_base<size_t, __gnu_cxx::__wvstring>
2923 {
return std::_Hash_impl::hash(__s.
data(),
2924 __s.
length() *
sizeof(wchar_t)); }
2928 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
2931 struct hash<__gnu_cxx::__u16vstring>
2932 :
public __hash_base<size_t, __gnu_cxx::__u16vstring>
2936 {
return std::_Hash_impl::hash(__s.
data(),
2937 __s.
length() *
sizeof(char16_t)); }
2942 struct hash<__gnu_cxx::__u32vstring>
2943 :
public __hash_base<size_t, __gnu_cxx::__u32vstring>
2947 {
return std::_Hash_impl::hash(__s.
data(),
2948 __s.
length() *
sizeof(char32_t)); }
2952 _GLIBCXX_END_NAMESPACE_VERSION