853 class deque :
protected _Deque_base<_Tp, _Alloc>
855#ifdef _GLIBCXX_CONCEPT_CHECKS
857 typedef typename _Alloc::value_type _Alloc_value_type;
858# if __cplusplus < 201103L
859 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
861 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
864#if __cplusplus >= 201103L
866 "std::deque must have a non-const, non-volatile value_type");
867# if __cplusplus > 201703L || defined __STRICT_ANSI__
869 "std::deque must have the same value_type as its allocator");
873 typedef _Deque_base<_Tp, _Alloc> _Base;
874 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
875 typedef typename _Base::_Alloc_traits _Alloc_traits;
876 typedef typename _Base::_Map_pointer _Map_pointer;
879 typedef _Tp value_type;
880 typedef typename _Alloc_traits::pointer pointer;
881 typedef typename _Alloc_traits::const_pointer const_pointer;
882 typedef typename _Alloc_traits::reference reference;
883 typedef typename _Alloc_traits::const_reference const_reference;
884 typedef typename _Base::iterator iterator;
885 typedef typename _Base::const_iterator const_iterator;
888 typedef size_t size_type;
889 typedef ptrdiff_t difference_type;
890 typedef _Alloc allocator_type;
893 static _GLIBCXX26_CONSTEXPR
size_t
894 _S_buffer_size() _GLIBCXX_NOEXCEPT
895 {
return __deque_buf_size(
sizeof(_Tp)); }
899 using _Base::_M_create_nodes;
900 using _Base::_M_destroy_nodes;
901 using _Base::_M_allocate_node;
902 using _Base::_M_deallocate_node;
903 using _Base::_M_allocate_map;
904 using _Base::_M_deallocate_map;
905 using _Base::_M_get_Tp_allocator;
911 using _Base::_M_impl;
920#if __cplusplus >= 201103L
930 explicit _GLIBCXX26_CONSTEXPR
934#if __cplusplus >= 201103L
943 explicit _GLIBCXX26_CONSTEXPR
944 deque(size_type __n,
const allocator_type& __a = allocator_type())
945 : _Base(__a, _S_check_init_len(__n, __a))
946 { _M_default_initialize(); }
957 deque(size_type __n,
const value_type& __value,
958 const allocator_type& __a = allocator_type())
959 : _Base(__a, _S_check_init_len(__n, __a))
972 const allocator_type& __a = allocator_type())
973 : _Base(__a, _S_check_init_len(__n, __a))
986 : _Base(_Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()),
988 { std::__uninitialized_copy_a(__x.
begin(), __x.
end(),
989 this->_M_impl._M_start,
990 _M_get_Tp_allocator()); }
992#if __cplusplus >= 201103L
1004 _GLIBCXX26_CONSTEXPR
1005 deque(
const deque& __x,
const __type_identity_t<allocator_type>& __a)
1006 : _Base(__a, __x.
size())
1007 { std::__uninitialized_copy_a(__x.
begin(), __x.
end(),
1008 this->_M_impl._M_start,
1009 _M_get_Tp_allocator()); }
1012 _GLIBCXX26_CONSTEXPR
1014 :
deque(
std::
move(__x), __a, typename _Alloc_traits::is_always_equal{})
1018 _GLIBCXX26_CONSTEXPR
1023 _GLIBCXX26_CONSTEXPR
1024 deque(deque&& __x,
const allocator_type& __a, false_type)
1027 if (__x.get_allocator() != __a && !__x.empty())
1029 std::__uninitialized_move_a(__x.begin(), __x.end(),
1030 this->_M_impl._M_start,
1031 _M_get_Tp_allocator());
1048 _GLIBCXX26_CONSTEXPR
1050 const allocator_type& __a = allocator_type())
1073#if __cplusplus >= 201103L
1074 template<
typename _InputIterator,
1075 typename = std::_RequireInputIter<_InputIterator>>
1076 _GLIBCXX26_CONSTEXPR
1077 deque(_InputIterator __first, _InputIterator __last,
1078 const allocator_type& __a = allocator_type())
1082 std::__iterator_category(__first));
1085 template<
typename _InputIterator>
1086 deque(_InputIterator __first, _InputIterator __last,
1087 const allocator_type& __a = allocator_type())
1091 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1092 _M_initialize_dispatch(__first, __last, _Integral());
1096#if __glibcxx_containers_ranges
1102 template<__detail::__container_compatible_range<_Tp> _Rg>
1103 _GLIBCXX26_CONSTEXPR
1104 deque(from_range_t, _Rg&& __rg,
const allocator_type& __a = _Alloc())
1114 _GLIBCXX26_CONSTEXPR
1116 { _M_destroy_data(
begin(),
end(), _M_get_Tp_allocator()); }
1127 _GLIBCXX26_CONSTEXPR
deque&
1130#if __cplusplus >= 201103L
1139 _GLIBCXX26_CONSTEXPR
deque&
1143 _M_move_assign1(
std::move(__x), __always_equal{});
1158 _GLIBCXX26_CONSTEXPR
deque&
1161 _M_assign_aux(__l.begin(), __l.end(),
1177 _GLIBCXX26_CONSTEXPR
void
1178 assign(size_type __n,
const value_type& __val)
1179 { _M_fill_assign(__n, __val); }
1193#if __cplusplus >= 201103L
1194 template<
typename _InputIterator,
1195 typename = std::_RequireInputIter<_InputIterator>>
1196 _GLIBCXX26_CONSTEXPR
void
1197 assign(_InputIterator __first, _InputIterator __last)
1198 { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
1200 template<
typename _InputIterator>
1202 assign(_InputIterator __first, _InputIterator __last)
1204 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1205 _M_assign_dispatch(__first, __last, _Integral());
1209#if __cplusplus >= 201103L
1221 _GLIBCXX26_CONSTEXPR
void
1226#if __glibcxx_containers_ranges
1233 template<__detail::__container_compatible_range<_Tp> _Rg>
1235 assign_range(_Rg&& __rg)
1241 const size_type __n(ranges::distance(__rg));
1244 auto __res = ranges::copy(__rg,
begin());
1245 return _M_erase_at_end(__res.out);
1248 auto __rest = ranges::copy_n(ranges::begin(__rg),
size(),
1250 _M_range_append(
std::move(__rest), ranges::end(__rg),
1255 auto __first = ranges::begin(__rg);
1256 const auto __last = ranges::end(__rg);
1257 for (iterator __it =
begin(), __end =
end();
1258 __it != __end; (void)++__first, ++__it)
1260 if (__first == __last)
1261 return _M_erase_at_end(__it);
1266 for (; __first != __last; ++__first)
1267 emplace_back(*__first);
1275 _GLIBCXX26_CONSTEXPR allocator_type
1277 {
return _Base::get_allocator(); }
1287 {
return this->_M_impl._M_start; }
1294 _GLIBCXX26_CONSTEXPR const_iterator
1296 {
return this->_M_impl._M_start; }
1306 {
return this->_M_impl._M_finish; }
1314 _GLIBCXX26_CONSTEXPR const_iterator
1316 {
return this->_M_impl._M_finish; }
1326 {
return reverse_iterator(this->_M_impl._M_finish); }
1334 _GLIBCXX26_CONSTEXPR const_reverse_iterator
1336 {
return const_reverse_iterator(this->_M_impl._M_finish); }
1346 {
return reverse_iterator(this->_M_impl._M_start); }
1354 _GLIBCXX26_CONSTEXPR const_reverse_iterator
1356 {
return const_reverse_iterator(this->_M_impl._M_start); }
1358#if __cplusplus >= 201103L
1364 _GLIBCXX26_CONSTEXPR const_iterator
1366 {
return this->_M_impl._M_start; }
1374 _GLIBCXX26_CONSTEXPR const_iterator
1376 {
return this->_M_impl._M_finish; }
1384 _GLIBCXX26_CONSTEXPR const_reverse_iterator
1386 {
return const_reverse_iterator(this->_M_impl._M_finish); }
1394 _GLIBCXX26_CONSTEXPR const_reverse_iterator
1396 {
return const_reverse_iterator(this->_M_impl._M_start); }
1405 size_type __sz = this->_M_impl._M_finish - this->_M_impl._M_start;
1407 __builtin_unreachable();
1415 {
return _S_max_size(_M_get_Tp_allocator()); }
1417#if __cplusplus >= 201103L
1427 _GLIBCXX26_CONSTEXPR
void
1430 const size_type __len =
size();
1431 if (__new_size > __len)
1432 _M_default_append(__new_size - __len);
1433 else if (__new_size < __len)
1434 _M_erase_at_end(this->_M_impl._M_start
1435 + difference_type(__new_size));
1449 _GLIBCXX26_CONSTEXPR
void
1450 resize(size_type __new_size,
const value_type& __x)
1464 resize(size_type __new_size, value_type __x = value_type())
1467 const size_type __len =
size();
1468 if (__new_size > __len)
1469 _M_fill_insert(this->_M_impl._M_finish, __new_size - __len, __x);
1470 else if (__new_size < __len)
1471 _M_erase_at_end(this->_M_impl._M_start
1472 + difference_type(__new_size));
1475#if __cplusplus >= 201103L
1477 _GLIBCXX26_CONSTEXPR
void
1479 { _M_shrink_to_fit(); }
1487 _GLIBCXX26_CONSTEXPR
bool
1489 {
return this->_M_impl._M_finish == this->_M_impl._M_start; }
1504 _GLIBCXX26_CONSTEXPR reference
1507 __glibcxx_requires_subscript(__n);
1508 return this->_M_impl._M_start[difference_type(__n)];
1523 _GLIBCXX26_CONSTEXPR const_reference
1526 __glibcxx_requires_subscript(__n);
1527 return this->_M_impl._M_start[difference_type(__n)];
1532 _GLIBCXX26_CONSTEXPR
void
1535 if (__n >= this->
size())
1536 __throw_out_of_range_fmt(__N(
"deque::_M_range_check: __n "
1537 "(which is %zu)>= this->size() "
1554 _GLIBCXX26_CONSTEXPR reference
1558 return (*
this)[__n];
1572 _GLIBCXX26_CONSTEXPR const_reference
1576 return (*
this)[__n];
1584 _GLIBCXX26_CONSTEXPR reference
1587 __glibcxx_requires_nonempty();
1596 _GLIBCXX26_CONSTEXPR const_reference
1599 __glibcxx_requires_nonempty();
1608 _GLIBCXX26_CONSTEXPR reference
1611 __glibcxx_requires_nonempty();
1612 iterator __tmp =
end();
1622 _GLIBCXX26_CONSTEXPR const_reference
1625 __glibcxx_requires_nonempty();
1626 const_iterator __tmp =
end();
1641 _GLIBCXX26_CONSTEXPR
void
1644 if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
1646 _Alloc_traits::construct(this->_M_impl,
1647 this->_M_impl._M_start._M_cur - 1,
1649 --this->_M_impl._M_start._M_cur;
1655#if __cplusplus >= 201103L
1656 _GLIBCXX26_CONSTEXPR
void
1660 template<
typename... _Args>
1661#if __cplusplus > 201402L
1662 _GLIBCXX26_CONSTEXPR reference
1666 emplace_front(_Args&&... __args);
1678 _GLIBCXX26_CONSTEXPR
void
1681 if (this->_M_impl._M_finish._M_cur
1682 != this->_M_impl._M_finish._M_last - 1)
1684 _Alloc_traits::construct(this->_M_impl,
1685 this->_M_impl._M_finish._M_cur, __x);
1686 ++this->_M_impl._M_finish._M_cur;
1692#if __cplusplus >= 201103L
1693 _GLIBCXX26_CONSTEXPR
void
1697 template<
typename... _Args>
1698#if __cplusplus > 201402L
1699 _GLIBCXX26_CONSTEXPR reference
1703 emplace_back(_Args&&... __args);
1714 _GLIBCXX26_CONSTEXPR
void
1717 __glibcxx_requires_nonempty();
1718 if (this->_M_impl._M_start._M_cur
1719 != this->_M_impl._M_start._M_last - 1)
1721 _Alloc_traits::destroy(_M_get_Tp_allocator(),
1722 this->_M_impl._M_start._M_cur);
1723 ++this->_M_impl._M_start._M_cur;
1737 _GLIBCXX26_CONSTEXPR
void
1740 __glibcxx_requires_nonempty();
1741 if (this->_M_impl._M_finish._M_cur
1742 != this->_M_impl._M_finish._M_first)
1744 --this->_M_impl._M_finish._M_cur;
1745 _Alloc_traits::destroy(_M_get_Tp_allocator(),
1746 this->_M_impl._M_finish._M_cur);
1752#if __cplusplus >= 201103L
1762 template<
typename... _Args>
1764 emplace(const_iterator __position, _Args&&... __args);
1775 _GLIBCXX26_CONSTEXPR iterator
1776 insert(const_iterator __position,
const value_type& __x);
1787 _GLIBCXX26_CONSTEXPR iterator
1788 insert(iterator __position,
const value_type& __x);
1791#if __cplusplus >= 201103L
1801 _GLIBCXX26_CONSTEXPR iterator
1802 insert(const_iterator __position, value_type&& __x)
1818 auto __offset = __p -
cbegin();
1819 _M_range_insert_aux(__p._M_const_cast(), __l.begin(), __l.end(),
1821 return begin() + __offset;
1835 insert(const_iterator __position, size_type __n,
const value_type& __x)
1837 difference_type __offset = __position -
cbegin();
1838 _M_fill_insert(__position._M_const_cast(), __n, __x);
1839 return begin() + __offset;
1851 _GLIBCXX26_CONSTEXPR
void
1853 { _M_fill_insert(__position, __n, __x); }
1856#if __cplusplus >= 201103L
1868 template<
typename _InputIterator,
1869 typename = std::_RequireInputIter<_InputIterator>>
1870 _GLIBCXX26_CONSTEXPR iterator
1871 insert(const_iterator __position, _InputIterator __first,
1872 _InputIterator __last)
1874 difference_type __offset = __position -
cbegin();
1875 _M_range_insert_aux(__position._M_const_cast(), __first, __last,
1876 std::__iterator_category(__first));
1877 return begin() + __offset;
1890 template<
typename _InputIterator>
1891 _GLIBCXX26_CONSTEXPR
void
1893 _InputIterator __last)
1896 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1897 _M_insert_dispatch(__position, __first, __last, _Integral());
1901#if __glibcxx_containers_ranges
1910 template<__detail::__container_compatible_range<_Tp> _Rg>
1911 _GLIBCXX26_CONSTEXPR iterator
1912 insert_range(const_iterator __pos, _Rg&& __rg);
1919 template<__detail::__container_compatible_range<_Tp> _Rg>
1920 _GLIBCXX26_CONSTEXPR
void
1921 prepend_range(_Rg&& __rg);
1928 template<__detail::__container_compatible_range<_Tp> _Rg>
1929 _GLIBCXX26_CONSTEXPR
void
1930 append_range(_Rg&& __rg);
1946 _GLIBCXX26_CONSTEXPR iterator
1947#if __cplusplus >= 201103L
1950 erase(iterator __position)
1952 {
return _M_erase(__position._M_const_cast()); }
1971#if __cplusplus >= 201103L
1972 erase(const_iterator __first, const_iterator __last)
1974 erase(iterator __first, iterator __last)
1976 {
return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
1989 _GLIBCXX26_CONSTEXPR
void
1992#if __cplusplus >= 201103L
1993 __glibcxx_assert(_Alloc_traits::propagate_on_container_swap::value
1994 || _M_get_Tp_allocator() == __x._M_get_Tp_allocator());
1996 _M_impl._M_swap_data(__x._M_impl);
1997 _Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),
1998 __x._M_get_Tp_allocator());
2007 _GLIBCXX26_CONSTEXPR
void
2009 { _M_erase_at_end(
begin()); }
2014#if __cplusplus < 201103L
2019 template<
typename _Integer>
2021 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
2023 _M_initialize_map(_S_check_init_len(
static_cast<size_type>(__n),
2024 _M_get_Tp_allocator()));
2029 template<
typename _InputIterator>
2031 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
2035 std::__iterator_category(__first));
2039 static _GLIBCXX26_CONSTEXPR
size_t
2040 _S_check_init_len(
size_t __n,
const allocator_type& __a)
2042 if (__n > _S_max_size(__a))
2043 __throw_length_error(
2044 __N(
"cannot create std::deque larger than max_size()"));
2048 static _GLIBCXX26_CONSTEXPR size_type
2049 _S_max_size(
const _Tp_alloc_type& __a) _GLIBCXX_NOEXCEPT
2051 const size_t __diffmax = __gnu_cxx::__numeric_traits<ptrdiff_t>::__max;
2053 return (
std::min)(__diffmax, __allocmax);
2067 template<
typename _InputIterator>
2068 _GLIBCXX26_CONSTEXPR
void
2073 template<
typename _ForwardIterator>
2074 _GLIBCXX26_CONSTEXPR
void
2088 _GLIBCXX26_CONSTEXPR
void
2091#if __cplusplus >= 201103L
2093 _GLIBCXX26_CONSTEXPR
void
2094 _M_default_initialize();
2100#if __cplusplus < 201103L
2105 template<
typename _Integer>
2107 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
2108 { _M_fill_assign(__n, __val); }
2111 template<
typename _InputIterator>
2113 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
2115 { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
2119 template<
typename _InputIterator>
2120 _GLIBCXX26_CONSTEXPR
void
2121 _M_assign_aux(_InputIterator __first, _InputIterator __last,
2125 template<
typename _ForwardIterator>
2126 _GLIBCXX26_CONSTEXPR
void
2127 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
2133 _ForwardIterator __mid = __first;
2135 std::copy(__first, __mid,
begin());
2136 _M_range_insert_aux(
end(), __mid, __last,
2137 std::__iterator_category(__first));
2140 _M_erase_at_end(std::copy(__first, __last,
begin()));
2145 _GLIBCXX26_CONSTEXPR
void
2146 _M_fill_assign(size_type __n,
const value_type& __val)
2151 _M_fill_insert(
end(), __n -
size(), __val);
2155 _M_erase_at_end(
begin() + difference_type(__n));
2162#if __cplusplus < 201103L
2167 template<
typename... _Args>
2168 _GLIBCXX26_CONSTEXPR
void
2171 template<
typename... _Args>
2172 _GLIBCXX26_CONSTEXPR
void
2176 _GLIBCXX26_CONSTEXPR
void
2179 _GLIBCXX26_CONSTEXPR
void
2186#if __cplusplus < 201103L
2191 template<
typename _Integer>
2192 _GLIBCXX26_CONSTEXPR
void
2193 _M_insert_dispatch(iterator __pos,
2194 _Integer __n, _Integer __x, __true_type)
2195 { _M_fill_insert(__pos, __n, __x); }
2198 template<
typename _InputIterator>
2199 _GLIBCXX26_CONSTEXPR
void
2201 _InputIterator __first, _InputIterator __last,
2204 _M_range_insert_aux(__pos, __first, __last,
2205 std::__iterator_category(__first));
2210 template<
typename _InputIterator,
typename _Sentinel>
2211 _GLIBCXX26_CONSTEXPR
void
2212 _M_range_prepend(_InputIterator __first, _Sentinel __last,
2216 template<
typename _InputIterator,
typename _Sentinel>
2217 _GLIBCXX26_CONSTEXPR
void
2218 _M_range_append(_InputIterator __first, _Sentinel __last,
2222 template<
typename _InputIterator>
2223 _GLIBCXX26_CONSTEXPR
void
2224 _M_range_insert_aux(iterator __pos, _InputIterator __first,
2228 template<
typename _ForwardIterator>
2229 _GLIBCXX26_CONSTEXPR
void
2230 _M_range_insert_aux(iterator __pos, _ForwardIterator __first,
2236 _GLIBCXX26_CONSTEXPR
void
2237 _M_fill_insert(iterator __pos, size_type __n,
const value_type& __x);
2240#if __cplusplus < 201103L
2242 _M_insert_aux(iterator __pos,
const value_type& __x);
2244 struct _Temporary_value
2246 template<
typename... _Args>
2247 explicit _GLIBCXX26_CONSTEXPR
2248 _Temporary_value(deque* __deque, _Args&&... __args) : _M_this(__deque)
2250 _Alloc_traits::construct(_M_this->_M_impl, _M_ptr(),
2254 _GLIBCXX26_CONSTEXPR
2256 { _Alloc_traits::destroy(_M_this->_M_impl, _M_ptr()); }
2258 _GLIBCXX26_CONSTEXPR value_type&
2259 _M_val() noexcept {
return __tmp_val; }
2262 _GLIBCXX26_CONSTEXPR _Tp*
2273 _GLIBCXX26_CONSTEXPR iterator
2274 _M_insert_aux(iterator __pos,
const value_type& __x)
2275 {
return _M_emplace_aux(__pos, __x); }
2277 template<
typename... _Args>
2278 _GLIBCXX26_CONSTEXPR iterator
2279 _M_emplace_aux(iterator __pos, _Args&&... __args);
2283 _GLIBCXX26_CONSTEXPR
void
2284 _M_insert_aux(iterator __pos, size_type __n,
const value_type& __x);
2287 template<
typename _ForwardIterator>
2288 _GLIBCXX26_CONSTEXPR
void
2289 _M_insert_aux(iterator __pos,
2290 _ForwardIterator __first, _ForwardIterator __last,
2296 _GLIBCXX26_CONSTEXPR
void
2297 _M_destroy_data_aux(iterator __first, iterator __last);
2301 template<
typename _Alloc1>
2302 _GLIBCXX26_CONSTEXPR
void
2303 _M_destroy_data(iterator __first, iterator __last,
const _Alloc1&)
2304 { _M_destroy_data_aux(__first, __last); }
2306 _GLIBCXX26_CONSTEXPR
void
2307 _M_destroy_data(iterator __first, iterator __last,
2308 const std::allocator<_Tp>&)
2310 if (!__has_trivial_destructor(value_type))
2311 _M_destroy_data_aux(__first, __last);
2315 _GLIBCXX26_CONSTEXPR
void
2316 _M_erase_at_begin(iterator __pos)
2318 _M_destroy_data(
begin(), __pos, _M_get_Tp_allocator());
2319 _M_destroy_nodes(this->_M_impl._M_start._M_node, __pos._M_node);
2320 this->_M_impl._M_start = __pos;
2325 _GLIBCXX26_CONSTEXPR
void
2326 _M_erase_at_end(iterator __pos)
2328 _M_destroy_data(__pos,
end(), _M_get_Tp_allocator());
2329 _M_destroy_nodes(__pos._M_node + 1,
2330 this->_M_impl._M_finish._M_node + 1);
2331 this->_M_impl._M_finish = __pos;
2334 _GLIBCXX26_CONSTEXPR iterator
2335 _M_erase(iterator __pos);
2337 _GLIBCXX26_CONSTEXPR iterator
2338 _M_erase(iterator __first, iterator __last);
2340#if __cplusplus >= 201103L
2342 _GLIBCXX26_CONSTEXPR
void
2343 _M_default_append(size_type __n);
2345 _GLIBCXX26_CONSTEXPR
bool
2351 _GLIBCXX26_CONSTEXPR iterator
2354 const size_type __vacancies = this->_M_impl._M_start._M_cur
2355 - this->_M_impl._M_start._M_first;
2356 if (__n > __vacancies)
2358 return this->_M_impl._M_start - difference_type(__n);
2364 const size_type __vacancies = (this->_M_impl._M_finish._M_last
2365 - this->_M_impl._M_finish._M_cur) - 1;
2366 if (__n > __vacancies)
2368 return this->_M_impl._M_finish + difference_type(__n);
2371 _GLIBCXX26_CONSTEXPR
void
2374 _GLIBCXX26_CONSTEXPR
void
2387 _GLIBCXX26_CONSTEXPR
void
2390 if (__nodes_to_add + 1 > this->_M_impl._M_map_size
2391 - (this->_M_impl._M_finish._M_node - this->_M_impl._M_map))
2395 _GLIBCXX26_CONSTEXPR
void
2398 if (__nodes_to_add > size_type(this->_M_impl._M_start._M_node
2399 - this->_M_impl._M_map))
2403 _GLIBCXX26_CONSTEXPR
void
2407#if __cplusplus >= 201103L
2410 _GLIBCXX26_CONSTEXPR
void
2413 this->_M_impl._M_swap_data(__x._M_impl);
2415 std::__alloc_on_move(_M_get_Tp_allocator(), __x._M_get_Tp_allocator());
2421 _GLIBCXX26_CONSTEXPR
void
2424 if (_M_get_Tp_allocator() == __x._M_get_Tp_allocator())
2427 constexpr bool __move_storage =
2428 _Alloc_traits::_S_propagate_on_move_assign();
2429 _M_move_assign2(
std::move(__x), __bool_constant<__move_storage>());
2434 template<
typename... _Args>
2435 _GLIBCXX26_CONSTEXPR
void
2436 _M_replace_map(_Args&&... __args)
2442 _M_deallocate_node(*
begin()._M_node);
2443 _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
2444 this->_M_impl._M_map =
nullptr;
2445 this->_M_impl._M_map_size = 0;
2447 this->_M_impl._M_swap_data(__newobj._M_impl);
2451 _GLIBCXX26_CONSTEXPR
void
2455 auto __alloc = __x._M_get_Tp_allocator();
2460 _M_get_Tp_allocator() =
std::move(__alloc);
2465 _GLIBCXX26_CONSTEXPR
void
2468 if (__x._M_get_Tp_allocator() == this->_M_get_Tp_allocator())
2472 _M_replace_map(
std::move(__x), __x.get_allocator());
2478 _M_assign_aux(std::make_move_iterator(__x.begin()),
2479 std::make_move_iterator(__x.end()),
2480 std::random_access_iterator_tag());