66#if __cplusplus >= 201103L
67 template <
typename _Tp,
typename _Alloc>
75 for (__cur = this->
_M_impl._M_start._M_node;
76 __cur < this->
_M_impl._M_finish._M_node;
80 std::__uninitialized_default_a(this->
_M_impl._M_finish._M_first,
81 this->_M_impl._M_finish._M_cur,
93 template <
typename _Tp,
typename _Alloc>
100#if __cplusplus >= 201103L
118 if (__len >= __x.
size())
120 this->_M_impl._M_start));
132#if __cplusplus >= 201103L
133 template<
typename _Tp,
typename _Alloc>
134 template<
typename... _Args>
135#if __cplusplus > 201402L
143 if (this->
_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
146 this->
_M_impl._M_start._M_cur - 1,
148 --this->
_M_impl._M_start._M_cur;
152#if __cplusplus > 201402L
157 template<
typename _Tp,
typename _Alloc>
158 template<
typename... _Args>
159#if __cplusplus > 201402L
167 if (this->
_M_impl._M_finish._M_cur
168 != this->_M_impl._M_finish._M_last - 1)
171 this->
_M_impl._M_finish._M_cur,
173 ++this->
_M_impl._M_finish._M_cur;
177#if __cplusplus > 201402L
183#if __cplusplus >= 201103L
184 template<
typename _Tp,
typename _Alloc>
185 template<
typename... _Args>
190 if (__position.
_M_cur == this->_M_impl._M_start._M_cur)
195 else if (__position.
_M_cur == this->_M_impl._M_finish._M_cur)
208 template <
typename _Tp,
typename _Alloc>
211#if __cplusplus >= 201103L
217 if (__position.
_M_cur == this->_M_impl._M_start._M_cur)
222 else if (__position.
_M_cur == this->_M_impl._M_finish._M_cur)
233 template <
typename _Tp,
typename _Alloc>
243 if (__position !=
begin())
253 return begin() + __index;
256 template <
typename _Tp,
typename _Alloc>
261 if (__first == __last)
263 else if (__first ==
begin() && __last ==
end())
272 if (
static_cast<size_type>(__elems_before) <= (
size() - __n) / 2)
274 if (__first !=
begin())
284 return begin() + __elems_before;
288 template <
typename _Tp,
class _Alloc>
289 template <
typename _InputIterator>
296 for (; __first != __last && __cur !=
end(); ++__cur, (void)++__first)
298 if (__first == __last)
305 template <
typename _Tp,
typename _Alloc>
310 if (__pos.
_M_cur == this->_M_impl._M_start._M_cur)
315 std::__uninitialized_fill_a(__new_start, this->
_M_impl._M_start,
317 this->
_M_impl._M_start = __new_start;
322 this->_M_impl._M_start._M_node);
326 else if (__pos.
_M_cur == this->_M_impl._M_finish._M_cur)
331 std::__uninitialized_fill_a(this->
_M_impl._M_finish,
334 this->
_M_impl._M_finish = __new_finish;
347#if __cplusplus >= 201103L
348 template <
typename _Tp,
typename _Alloc>
358 std::__uninitialized_default_a(this->
_M_impl._M_finish,
361 this->
_M_impl._M_finish = __new_finish;
372 template <
typename _Tp,
typename _Alloc>
378 = (this->
_M_impl._M_start._M_cur - this->
_M_impl._M_start._M_first);
379 if (__front_capacity == 0)
383 = (this->
_M_impl._M_finish._M_last - this->
_M_impl._M_finish._M_cur);
387 return std::__shrink_to_fit_aux<deque>::_S_do_it(*
this);
391 template <
typename _Tp,
typename _Alloc>
399 for (__cur = this->
_M_impl._M_start._M_node;
400 __cur < this->
_M_impl._M_finish._M_node;
404 std::__uninitialized_fill_a(this->
_M_impl._M_finish._M_first,
405 this->_M_impl._M_finish._M_cur,
416 template <
typename _Tp,
typename _Alloc>
417 template <
typename _InputIterator>
426 for (; __first != __last; ++__first)
427#
if __cplusplus >= 201103L
440 template <
typename _Tp,
typename _Alloc>
441 template <
typename _ForwardIterator>
453 for (__cur_node = this->
_M_impl._M_start._M_node;
454 __cur_node < this->
_M_impl._M_finish._M_node;
458 __builtin_unreachable();
460 _ForwardIterator __mid = __first;
467 this->
_M_impl._M_finish._M_first,
480 template<
typename _Tp,
typename _Alloc>
481#if __cplusplus >= 201103L
482 template<
typename... _Args>
494 __N(
"cannot create std::deque larger than max_size()"));
500#if __cplusplus >= 201103L
502 this->
_M_impl._M_finish._M_cur,
507 this->
_M_impl._M_finish._M_set_node(this->
_M_impl._M_finish._M_node
509 this->
_M_impl._M_finish._M_cur = this->
_M_impl._M_finish._M_first;
519 template<
typename _Tp,
typename _Alloc>
520#if __cplusplus >= 201103L
521 template<
typename... _Args>
533 __N(
"cannot create std::deque larger than max_size()"));
541 this->
_M_impl._M_start._M_cur = this->
_M_impl._M_start._M_last - 1;
542#if __cplusplus >= 201103L
559 template <
typename _Tp,
typename _Alloc>
564 this->
_M_impl._M_finish._M_set_node(this->
_M_impl._M_finish._M_node - 1);
565 this->
_M_impl._M_finish._M_cur = this->
_M_impl._M_finish._M_last - 1;
567 this->
_M_impl._M_finish._M_cur);
575 template <
typename _Tp,
typename _Alloc>
580 this->
_M_impl._M_start._M_cur);
582 this->
_M_impl._M_start._M_set_node(this->
_M_impl._M_start._M_node + 1);
586 template <
typename _Tp,
typename _Alloc>
587 template <
typename _InputIterator,
typename _Sentinel>
598 this->
_M_impl._M_start = __new_start;
603 this->_M_impl._M_start._M_node);
608 template <
typename _Tp,
typename _Alloc>
609 template <
typename _InputIterator,
typename _Sentinel>
621 this->
_M_impl._M_finish = __new_finish;
631 template <
typename _Tp,
typename _Alloc>
632 template <
typename _InputIterator>
636 _InputIterator __first, _InputIterator __last,
640 template <
typename _Tp,
typename _Alloc>
641 template <
typename _ForwardIterator>
645 _ForwardIterator __first, _ForwardIterator __last,
649 if (__builtin_expect(__n == 0, 0))
652 if (__pos.
_M_cur == this->_M_impl._M_start._M_cur)
654 else if (__pos.
_M_cur == this->_M_impl._M_finish._M_cur)
660 template<
typename _Tp,
typename _Alloc>
661#if __cplusplus >= 201103L
662 template<
typename... _Args>
686 __pos = this->
_M_impl._M_start + __index;
698 __pos = this->
_M_impl._M_start + __index;
701#if __cplusplus >= 201103L
709 template <
typename _Tp,
typename _Alloc>
721 __pos = this->
_M_impl._M_start + __elems_before;
729 __start_n, __new_start,
731 this->
_M_impl._M_start = __new_start;
737 std::__uninitialized_move_fill(this->
_M_impl._M_start,
739 this->_M_impl._M_start,
742 this->
_M_impl._M_start = __new_start;
749 this->_M_impl._M_start._M_node);
759 __pos = this->
_M_impl._M_finish - __elems_after;
768 this->_M_impl._M_finish,
770 this->
_M_impl._M_finish = __new_finish;
776 std::__uninitialized_fill_move(this->
_M_impl._M_finish,
781 this->
_M_impl._M_finish = __new_finish;
782 std::fill(__pos, __old_finish, __x_copy);
794 template <
typename _Tp,
typename _Alloc>
795 template <
typename _ForwardIterator>
799 _ForwardIterator __first, _ForwardIterator __last,
804 if (
static_cast<size_type>(__elemsbefore) < __length / 2)
808 __pos = this->
_M_impl._M_start + __elemsbefore;
816 __start_n, __new_start,
818 this->
_M_impl._M_start = __new_start;
824 _ForwardIterator __mid = __first;
826 std::__uninitialized_move_copy(this->
_M_impl._M_start,
827 __pos, __first, __mid,
830 this->
_M_impl._M_start = __new_start;
837 this->_M_impl._M_start._M_node);
847 __pos = this->
_M_impl._M_finish - __elemsafter;
856 this->_M_impl._M_finish,
858 this->
_M_impl._M_finish = __new_finish;
864 _ForwardIterator __mid = __first;
866 std::__uninitialized_copy_move(__mid, __last, __pos,
868 this->_M_impl._M_finish,
870 this->
_M_impl._M_finish = __new_finish;
883#if __glibcxx_containers_ranges
884 template<ranges::forward_range _Rg>
885 auto __advance_dist(_Rg& __rg)
892 if constexpr (ranges::common_range<_Rg>)
893 return _Res{ranges::end(__rg), ranges::distance(__rg)};
902 return _Res{__it, __n};
909 for (; __it != __last; ++__it)
911 return _Res{__it, __n};
915 template<
typename _Tp,
typename _Alloc>
916 template<__detail::__container_compatible_range<_Tp> _Rg>
924 const auto __ins_idx =
size();
926 return begin() + __ins_idx;
935 const auto __ins_idx = __pos -
cbegin();
938 auto [__last, __n] = __advance_dist(__rg);
939 if (__n != 0) [[likely]]
949 (
void)++__first, ++__it)
950 __it = _M_emplace_aux(__it, *__first);
952 return begin() + __ins_idx;
955 template<
typename _Tp,
typename _Alloc>
956 template<__detail::__container_compatible_range<_Tp> _Rg>
966 if (__n != 0) [[likely]]
971 struct _Guard_elts_front
979 __self._M_erase_at_begin(__self.begin() + __n);
983 _Guard_elts_front
__guard{*
this};
986 for (; __first != __last; (void)++__first, ++
__guard.__n)
987 emplace_front(*__first);
990 __fins != __lins && __fins != --__lins; ++__fins)
997 template<
typename _Tp,
typename _Alloc>
998 template<__detail::__container_compatible_range<_Tp> _Rg>
1006 if (__n != 0) [[likely]]
1011 struct _Guard_elts_back
1014 size_type __n = __self.size();
1018 if (__n < __self.size())
1019 __self._M_erase_at_end(__self.begin() + __n);
1023 _Guard_elts_back
__guard{*
this};
1026 for (; __first != __last; (void)++__first)
1027 emplace_back(*__first);
1034 template<
typename _Tp,
typename _Alloc>
1040 __node < __last.
_M_node; ++__node)
1056 template <
typename _Tp,
typename _Alloc>
1070 for (__i = 1; __i <= __new_nodes; ++__i)
1075 for (
size_type __j = 1; __j < __i; ++__j)
1081 template <
typename _Tp,
typename _Alloc>
1095 for (__i = 1; __i <= __new_nodes; ++__i)
1100 for (
size_type __j = 1; __j < __i; ++__j)
1106 template <
typename _Tp,
typename _Alloc>
1112 = this->
_M_impl._M_finish._M_node - this->
_M_impl._M_start._M_node + 1;
1113 const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
1116 if (this->
_M_impl._M_map_size > 2 * __new_num_nodes)
1119 - __new_num_nodes) / 2
1120 + (__add_at_front ? __nodes_to_add : 0);
1121 if (__new_nstart < this->
_M_impl._M_start._M_node)
1123 this->_M_impl._M_finish._M_node + 1,
1127 this->_M_impl._M_finish._M_node + 1,
1128 __new_nstart + __old_num_nodes);
1134 __nodes_to_add) + 2;
1137 if (__new_map_size > ((
max_size() + __bufsz - 1) / __bufsz) * 2)
1138 __builtin_unreachable();
1141 __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
1142 + (__add_at_front ? __nodes_to_add : 0);
1144 this->_M_impl._M_finish._M_node + 1,
1148 this->
_M_impl._M_map = __new_map;
1149 this->
_M_impl._M_map_size = __new_map_size;
1152 this->
_M_impl._M_start._M_set_node(__new_nstart);
1153 this->
_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
1160 template<
typename _Tp,
typename _VTp>
1162 __fill_a1(
const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
1163 const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>& __last,
1164 const _VTp& __value)
1166 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> _Iter;
1167 if (__first._M_node != __last._M_node)
1171 for (
typename _Iter::_Map_pointer __node = __first._M_node + 1;
1172 __node < __last._M_node; ++__node)
1173 std::__fill_a1(*__node, *__node + _Iter::_S_buffer_size(), __value);
1181 template<
bool _IsMove,
1182 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
1185 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last,
1188 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> _Iter;
1189 if (__first._M_node != __last._M_node)
1195 for (
typename _Iter::_Map_pointer __node = __first._M_node + 1;
1196 __node != __last._M_node; ++__node)
1199 *__node + _Iter::_S_buffer_size(),
1210 template<
bool _IsMove,
1211 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
1214 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last,
1218 template<
bool _IsMove,
1219 typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp>
1220 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
1222 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __last,
1223 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result)
1226 template<
bool _IsMove,
typename _II,
typename _Tp>
1228 __is_any_random_access_iter<_II>::__value,
1229 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type
1231 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> __result)
1233 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> _Iter;
1240 =
std::min(__len, __result._M_last - __result._M_cur);
1252 template<
bool _IsMove,
typename _CharT>
1254 __is_char<_CharT>::__value,
1255 _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> >::__type
1259 _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> __result)
1261 if (__first == __last)
1279 template<
typename _CharT,
typename _Size>
1281 __is_char<_CharT>::__value,
1282 _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> >::__type
1285 _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> __result,
1299 while (__size != 0);
1303 template<
bool _IsMove,
1304 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
1307 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first,
1308 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last,
1311 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> _Iter;
1312 if (__first._M_node != __last._M_node)
1315 __last._M_first, __last._M_cur, __result);
1317 for (
typename _Iter::_Map_pointer __node = __last._M_node - 1;
1318 __node != __first._M_node; --__node)
1320 *__node, *__node + _Iter::_S_buffer_size(), __result);
1323 __first._M_cur, __first._M_last, __result);
1327 __first._M_cur, __last._M_cur, __result);
1330 template<
bool _IsMove,
1331 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
1334 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first,
1335 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last,
1339 template<
bool _IsMove,
1340 typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp>
1341 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
1343 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __first,
1344 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __last,
1345 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result)
1348 template<
bool _IsMove,
typename _II,
typename _Tp>
1350 __is_any_random_access_iter<_II>::__value,
1351 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type
1353 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> __result)
1355 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> _Iter;
1362 _Tp* __rend = __result._M_cur;
1365 __rlen = _Iter::_S_buffer_size();
1366 __rend = *(__result._M_node - 1) + __rlen;
1380 template<
typename _Tp,
typename _Ref,
typename _Ptr,
typename _II>
1383 const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>& __first1,
1384 const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>& __last1,
1387 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> _Iter;
1388 if (__first1._M_node != __last1._M_node)
1393 __first2 += __first1._M_last - __first1._M_cur;
1394 for (
typename _Iter::_Map_pointer __node = __first1._M_node + 1;
1395 __node != __last1._M_node;
1396 __first2 += _Iter::_S_buffer_size(), ++__node)
1407 template<
typename _Tp,
typename _Ref,
typename _Ptr,
typename _II>
1409 __is_any_random_access_iter<_II>::__value,
bool>::__type
1411 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last1,
1415 template<
typename _Tp1,
typename _Ref1,
typename _Ptr1,
1416 typename _Tp2,
typename _Ref2,
typename _Ptr2>
1419 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __last1,
1420 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __first2)
1423 template<
typename _II,
typename _Tp,
typename _Ref,
typename _Ptr>
1425 __is_any_random_access_iter<_II>::__value,
bool>::__type
1427 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first2)
1429 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> _Iter;
1436 =
std::min(__len, __first2._M_last - __first2._M_cur);
1448 template<
typename _Tp1,
typename _Ref,
typename _Ptr,
typename _Tp2>
1451 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref, _Ptr> __first1,
1452 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref, _Ptr> __last1,
1453 const _Tp2* __first2,
const _Tp2* __last2)
1455#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
1456 const bool __simple =
1458 && __is_pointer(_Ptr)
1459#if __cplusplus > 201703L && __cpp_lib_concepts
1463 && !is_volatile_v<_Tp1> && !is_volatile_v<_Tp2>
1471 while (__first1._M_node != __last1._M_node)
1473 const ptrdiff_t __len1 = __first1._M_last - __first1._M_cur;
1474 const ptrdiff_t __len2 = __last2 - __first2;
1477 if (
int __ret = _Lc::__3way(__first1._M_cur, __first1._M_last,
1478 __first2, __first2 + __len))
1484 return _Lc::__3way(__first1._M_cur, __last1._M_cur,
1488 template<
typename _Tp1,
typename _Ref1,
typename _Ptr1,
1492 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __first1,
1493 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __last1,
1494 _Tp2* __first2, _Tp2* __last2)
1497 template<
typename _Tp1,
1498 typename _Tp2,
typename _Ref2,
typename _Ptr2>
1501 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __first2,
1502 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __last2)
1505 template<
typename _Tp1,
typename _Ref1,
typename _Ptr1,
1506 typename _Tp2,
typename _Ref2,
typename _Ptr2>
1509 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __first1,
1510 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __last1,
1511 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __first2,
1512 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __last2)
1514#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
1515 const bool __simple =
1517 && __is_pointer(_Ptr1) && __is_pointer(_Ptr2)
1518#if __cplusplus > 201703L && __cpp_lib_concepts
1522 && !is_volatile_v<_Tp1> && !is_volatile_v<_Tp2>
1530 while (__first1 != __last1)
1532 const ptrdiff_t __len2 = __first2._M_node == __last2._M_node
1533 ? __last2._M_cur - __first2._M_cur
1534 : __first2._M_last - __first2._M_cur;
1537 const ptrdiff_t __len1 = __first1._M_node == __last1._M_node
1538 ? __last1._M_cur - __first1._M_cur
1539 : __first1._M_last - __first1._M_cur;
1541 if (
int __ret = _Lc::__3way(__first1._M_cur, __first1._M_cur + __len,
1542 __first2._M_cur, __first2._M_cur + __len))
1549 return __last2 != __first2;
1552#if __cplusplus >= 201103L
1553#pragma GCC diagnostic push
1554#pragma GCC diagnostic ignored "-Wc++17-extensions"
1555 template<
typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp,
1557 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
1559 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __first,
1560 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __last,
1561 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result,
1566 if constexpr (!__is_nothrow_constructible(_OTp, _IRef))
1567 return std::__do_uninit_copy(__first, __last, __result);
1569 while (__first != __last)
1571 auto __from = __first._M_cur;
1573 if (__first._M_node == __last._M_node)
1574 __n = __last._M_cur - __from;
1576 __n = __first._M_last - __from;
1577 _OTp* __sres = __result._M_cur;
1586 template<
typename _Iter,
typename _OTp,
typename _Tp>
1587 __enable_if_t<__is_random_access_iter<_Iter>::value,
1588 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>>
1590 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result,
1595 if constexpr (!__is_nothrow_constructible(_OTp,
decltype(*__first)))
1596 return std::__do_uninit_copy(__first, __last, __result);
1598 while (__first != __last)
1601 __result._M_last - __result._M_cur);
1609 template<
typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp,
1611 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
1613 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __first,
1614 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __last,
1615 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result,
1620 if constexpr (!__is_nothrow_constructible(_OTp,
1626 while (__first != __last)
1628 auto __from = __first._M_cur;
1630 if (__first._M_node == __last._M_node)
1631 __n = __last._M_cur - __from;
1633 __n = __first._M_last - __from;
1643#pragma GCC diagnostic pop
#define _GLIBCXX_MOVE(__val)
#define _GLIBCXX_MOVE3(_Tp, _Up, _Vp)
#define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp)
#define __throw_exception_again
#define _GLIBCXX_VISIBILITY(V)
#define _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_END_NAMESPACE_CONTAINER
#define _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_ForwardIterator uninitialized_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result)
Copies the range [first,last) into result.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
_Tp * begin(valarray< _Tp > &__va) noexcept
Return an iterator pointing to the first element of the valarray.
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
constexpr iterator_traits< _Iter >::iterator_category __iterator_category(const _Iter &)
constexpr move_iterator< _Iterator > make_move_iterator(_Iterator __i)
constexpr insert_iterator< _Container > inserter(_Container &__x, std::__detail::__range_iter_t< _Container > __i)
::_Deque_iterator< _OTp, _OTp &, _OTp * > __uninitialized_move_a(::_Deque_iterator< _ITp, _IRef, _IPtr > __first, ::_Deque_iterator< _ITp, _IRef, _IPtr > __last, ::_Deque_iterator< _OTp, _OTp &, _OTp * > __result, allocator< _Tp > &)
__gnu_cxx::__enable_if< __is_char< _CharT >::__value,::_Deque_iterator< _CharT, _CharT &, _CharT * > >::__type __copy_n_a(istreambuf_iterator< _CharT, char_traits< _CharT > > __it, _Size __size, ::_Deque_iterator< _CharT, _CharT &, _CharT * > __result, bool __strict)
bool __equal_dit(const ::_Deque_iterator< _Tp, _Ref, _Ptr > &__first1, const ::_Deque_iterator< _Tp, _Ref, _Ptr > &__last1, _II __first2)
constexpr size_t __deque_buf_size(size_t __size)
__gnu_cxx::__enable_if< __is_char< _CharT >::__value,::_Deque_iterator< _CharT, _CharT &, _CharT * > >::__type __copy_move_a2(istreambuf_iterator< _CharT, char_traits< _CharT > > __first, istreambuf_iterator< _CharT, char_traits< _CharT > > __last, ::_Deque_iterator< _CharT, _CharT &, _CharT * > __result)
__PTRDIFF_TYPE__ ptrdiff_t
void __fill_a1(const ::_Deque_iterator< _Tp, _Tp &, _Tp * > &__first, const ::_Deque_iterator< _Tp, _Tp &, _Tp * > &__last, const _VTp &__value)
_OI __copy_move_a1(::_Deque_iterator< _Tp, _Ref, _Ptr > __first, ::_Deque_iterator< _Tp, _Ref, _Ptr > __last, _OI __result)
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
_OI __copy_move_backward_dit(::_Deque_iterator< _Tp, _Ref, _Ptr > __first, ::_Deque_iterator< _Tp, _Ref, _Ptr > __last, _OI __result)
constexpr _OIter copy(_IIter, _IIter, _OIter)
constexpr auto cend(const _Container &__cont) noexcept(noexcept(std::end(__cont))) -> decltype(std::end(__cont))
Return an iterator pointing to one past the last element of the const container.
constexpr auto empty(const _Container &__cont) noexcept(noexcept(__cont.empty())) -> decltype(__cont.empty())
Return whether a container is empty.
bool __lexicographical_compare_aux1(::_Deque_iterator< _Tp1, _Ref1, _Ptr1 > __first1, ::_Deque_iterator< _Tp1, _Ref1, _Ptr1 > __last1, _Tp2 *__first2, _Tp2 *__last2)
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
::_Deque_iterator< _OTp, _OTp &, _OTp * > __uninitialized_copy_a(::_Deque_iterator< _ITp, _IRef, _IPtr > __first, ::_Deque_iterator< _ITp, _IRef, _IPtr > __last, ::_Deque_iterator< _OTp, _OTp &, _OTp * > __result, allocator< _Tp > &)
constexpr _BIter2 copy_backward(_BIter1, _BIter1, _BIter2)
constexpr void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
__gnu_cxx::__enable_if< __is_any_random_access_iter< _II >::__value, bool >::__type __equal_aux1(::_Deque_iterator< _Tp, _Ref, _Ptr > __first1, ::_Deque_iterator< _Tp, _Ref, _Ptr > __last1, _II __first2)
constexpr void fill(_FIter, _FIter, const _Tp &)
constexpr void iter_swap(_FIter1, _FIter2)
constexpr auto cbegin(const _Container &__cont) noexcept(noexcept(std::begin(__cont))) -> decltype(std::begin(__cont))
Return an iterator pointing to the first element of the const container.
_OI __copy_move_dit(::_Deque_iterator< _Tp, _Ref, _Ptr > __first, ::_Deque_iterator< _Tp, _Ref, _Ptr > __last, _OI __result)
int __lex_cmp_dit(::_Deque_iterator< _Tp1, _Ref, _Ptr > __first1, ::_Deque_iterator< _Tp1, _Ref, _Ptr > __last1, const _Tp2 *__first2, const _Tp2 *__last2)
constexpr void _Destroy(_ForwardIterator __first, _ForwardIterator __last)
_OI __copy_move_backward_a1(::_Deque_iterator< _Tp, _Ref, _Ptr > __first, ::_Deque_iterator< _Tp, _Ref, _Ptr > __last, _OI __result)
void __throw_length_error(const char *)
ISO C++ entities toplevel namespace is std.
__extension__ typedef int __guard
iter_difference_t< iterator_t< _Range > > range_difference_t
constexpr __advance_fn advance
std::__detail::__range_iter_t< _Tp > iterator_t
constexpr __distance_fn distance
constexpr ranges::__access::_Begin begin
constexpr ranges::__access::_End end
std::deque< _Tp, polymorphic_allocator< _Tp > > deque
Provides input iterator semantics for streambufs.
The standard allocator, as per C++03 [20.4.1].
Basis for explicit traits specializations.
static const bool __value
iterator _M_const_cast() const noexcept
void _M_initialize_map(size_t)
Layout storage.
void _M_deallocate_node(_Ptr __p) noexcept
void pop_back() noexcept
Removes last element.
size_type size() const noexcept
iterator _M_reserve_elements_at_front(size_type __n)
Memory-handling helpers for the previous internal insert functions.
ptrdiff_t difference_type
void _M_range_insert_aux(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag)
void pop_front() noexcept
Removes first element.
allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
_Map_pointer _M_allocate_map(size_t __n)
reference emplace_front(_Args &&... __args)
void _M_erase_at_begin(iterator __pos)
size_type max_size() const noexcept
void push_front(const value_type &__x)
Add data to the front of the deque.
iterator insert(const_iterator __position, const value_type &__x)
Inserts given value into deque before specified iterator.
void _M_erase_at_end(iterator __pos)
iterator _M_emplace_aux(iterator __pos, _Args &&... __args)
void _M_range_append(_InputIterator __first, _Sentinel __last, size_type __n)
void _M_deallocate_map(_Map_pointer __p, size_t __n) noexcept
_Base::const_iterator const_iterator
void _M_reserve_map_at_back(size_type __nodes_to_add=1)
Memory-handling helpers for the major map.
reference back() noexcept
deque()=default
Creates a deque with no elements.
void _M_push_back_aux(_Args &&... __args)
Helper functions for push_* and pop_*.
void push_back(const value_type &__x)
Add data to the end of the deque.
void _M_reserve_map_at_front(size_type __nodes_to_add=1)
Memory-handling helpers for the major map.
void _M_replace_map(_Args &&... __args)
reference emplace_back(_Args &&... __args)
void _M_push_front_aux(_Args &&... __args)
Helper functions for push_* and pop_*.
void _M_range_prepend(_InputIterator __first, _Sentinel __last, size_type __n)
static size_t _S_buffer_size() noexcept
_Alloc_traits::reference reference
_Tp_alloc_type & _M_get_Tp_allocator() noexcept
void _M_destroy_nodes(_Map_pointer __nstart, _Map_pointer __nfinish) noexcept
reference front() noexcept
iterator _M_reserve_elements_at_back(size_type __n)
Memory-handling helpers for the previous internal insert functions.
_Base::_Map_pointer _Map_pointer
iterator _M_insert_aux(iterator __pos, const value_type &__x)
iterator begin() noexcept
static size_t _S_check_init_len(size_t __n, const allocator_type &__a)
A standard container using fixed-size memory allocation and constant-time manipulation of elements at...
constexpr value_type & _M_val() noexcept
Forward iterators support a superset of input iterator operations.
Random-access iterators support a superset of bidirectional iterator operations.
static constexpr bool _S_always_equal()
static constexpr std::__enable_if_t< __is_custom_pointer< _Ptr >::value > destroy(_Tp_alloc_type &__a, _Ptr __p) noexcept(noexcept(_Base_type::destroy(__a, std::__to_address(__p))))
static constexpr std::__enable_if_t< __is_custom_pointer< _Ptr >::value > construct(_Tp_alloc_type &__a, _Ptr __p, _Args &&... __args) noexcept(noexcept(_Base_type::construct(__a, std::__to_address(__p), std::forward< _Args >(__args)...)))
static constexpr bool _S_propagate_on_copy_assign()
[range.sized] The sized_range concept.
A range for which ranges::begin returns a forward iterator.
A range for which ranges::begin returns a random access iterator.