61namespace std _GLIBCXX_VISIBILITY(default)
63_GLIBCXX_BEGIN_NAMESPACE_VERSION
64_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
66#if __cplusplus >= 201103L
67 template <
typename _Tp,
typename _Alloc>
68 _GLIBCXX26_CONSTEXPR
void
75 for (__cur = this->_M_impl._M_start._M_node;
76 __cur < this->_M_impl._M_finish._M_node;
78 std::__uninitialized_default_a(*__cur, *__cur + _S_buffer_size(),
79 _M_get_Tp_allocator());
80 std::__uninitialized_default_a(this->_M_impl._M_finish._M_first,
81 this->_M_impl._M_finish._M_cur,
82 _M_get_Tp_allocator());
87 _M_get_Tp_allocator());
88 __throw_exception_again;
93 template <
typename _Tp,
typename _Alloc>
101#if __cplusplus >= 201103L
102 if (_Alloc_traits::_S_propagate_on_copy_assign())
104 if (!_Alloc_traits::_S_always_equal()
105 && _M_get_Tp_allocator() != __x._M_get_Tp_allocator())
110 std::__alloc_on_copy(_M_get_Tp_allocator(),
111 __x._M_get_Tp_allocator());
114 std::__alloc_on_copy(_M_get_Tp_allocator(),
115 __x._M_get_Tp_allocator());
118 const size_type __len =
size();
119 if (__len >= __x.
size())
120 _M_erase_at_end(std::copy(__x.
begin(), __x.
end(),
121 this->_M_impl._M_start));
124 const_iterator __mid = __x.
begin() + difference_type(__len);
125 std::copy(__x.
begin(), __mid, this->_M_impl._M_start);
126 _M_range_insert_aux(this->_M_impl._M_finish, __mid, __x.
end(),
133#if __cplusplus >= 201103L
134 template<
typename _Tp,
typename _Alloc>
135 template<
typename... _Args>
136#if __cplusplus > 201402L
138 typename deque<_Tp, _Alloc>::reference
145 if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
147 _Alloc_traits::construct(this->_M_impl,
148 this->_M_impl._M_start._M_cur - 1,
150 --this->_M_impl._M_start._M_cur;
154#if __cplusplus > 201402L
159 template<
typename _Tp,
typename _Alloc>
160 template<
typename... _Args>
161#if __cplusplus > 201402L
163 typename deque<_Tp, _Alloc>::reference
170 if (this->_M_impl._M_finish._M_cur
171 != this->_M_impl._M_finish._M_last - 1)
173 _Alloc_traits::construct(this->_M_impl,
174 this->_M_impl._M_finish._M_cur,
176 ++this->_M_impl._M_finish._M_cur;
180#if __cplusplus > 201402L
186#if __cplusplus >= 201103L
187 template<
typename _Tp,
typename _Alloc>
188 template<
typename... _Args>
190 typename deque<_Tp, _Alloc>::iterator
192 emplace(const_iterator __position, _Args&&... __args)
194 if (__position._M_cur == this->_M_impl._M_start._M_cur)
197 return this->_M_impl._M_start;
199 else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
202 iterator __tmp = this->_M_impl._M_finish;
207 return _M_emplace_aux(__position._M_const_cast(),
212 template <
typename _Tp,
typename _Alloc>
214 typename deque<_Tp, _Alloc>::iterator
216#if __cplusplus >= 201103L
217 insert(const_iterator __position,
const value_type& __x)
219 insert(iterator __position,
const value_type& __x)
222 if (__position._M_cur == this->_M_impl._M_start._M_cur)
225 return this->_M_impl._M_start;
227 else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
230 iterator __tmp = this->_M_impl._M_finish;
235 return _M_insert_aux(__position._M_const_cast(), __x);
238 template <
typename _Tp,
typename _Alloc>
240 typename deque<_Tp, _Alloc>::iterator
249 if (__position !=
begin())
250 _GLIBCXX_MOVE_BACKWARD3(
begin(), __position, __next);
256 _GLIBCXX_MOVE3(__next,
end(), __position);
259 return begin() + __index;
262 template <
typename _Tp,
typename _Alloc>
264 typename deque<_Tp, _Alloc>::iterator
268 if (__first == __last)
270 else if (__first ==
begin() && __last ==
end())
279 if (
static_cast<size_type>(__elems_before) <= (
size() - __n) / 2)
281 if (__first !=
begin())
282 _GLIBCXX_MOVE_BACKWARD3(
begin(), __first, __last);
283 _M_erase_at_begin(
begin() + __n);
288 _GLIBCXX_MOVE3(__last,
end(), __first);
289 _M_erase_at_end(
end() - __n);
291 return begin() + __elems_before;
295 template <
typename _Tp,
class _Alloc>
296 template <
typename _InputIterator>
297 _GLIBCXX26_CONSTEXPR
void
300 std::input_iterator_tag)
303 for (; __first != __last && __cur !=
end(); ++__cur, (void)++__first)
305 if (__first == __last)
306 _M_erase_at_end(__cur);
308 _M_range_insert_aux(
end(), __first, __last,
309 std::__iterator_category(__first));
312 template <
typename _Tp,
typename _Alloc>
313 _GLIBCXX26_CONSTEXPR
void
317 if (__pos._M_cur == this->_M_impl._M_start._M_cur)
319 iterator __new_start = _M_reserve_elements_at_front(__n);
322 std::__uninitialized_fill_a(__new_start, this->_M_impl._M_start,
323 __x, _M_get_Tp_allocator());
324 this->_M_impl._M_start = __new_start;
328 _M_destroy_nodes(__new_start._M_node,
329 this->_M_impl._M_start._M_node);
330 __throw_exception_again;
333 else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
335 iterator __new_finish = _M_reserve_elements_at_back(__n);
338 std::__uninitialized_fill_a(this->_M_impl._M_finish,
340 _M_get_Tp_allocator());
341 this->_M_impl._M_finish = __new_finish;
345 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
346 __new_finish._M_node + 1);
347 __throw_exception_again;
351 _M_insert_aux(__pos, __n, __x);
354#if __cplusplus >= 201103L
355 template <
typename _Tp,
typename _Alloc>
356 _GLIBCXX26_CONSTEXPR
void
362 iterator __new_finish = _M_reserve_elements_at_back(__n);
365 std::__uninitialized_default_a(this->_M_impl._M_finish,
367 _M_get_Tp_allocator());
368 this->_M_impl._M_finish = __new_finish;
372 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
373 __new_finish._M_node + 1);
374 __throw_exception_again;
379 template <
typename _Tp,
typename _Alloc>
380 _GLIBCXX26_CONSTEXPR
bool
385 = (this->_M_impl._M_start._M_cur - this->_M_impl._M_start._M_first);
386 if (__front_capacity == 0)
390 = (this->_M_impl._M_finish._M_last - this->_M_impl._M_finish._M_cur);
391 if (
size_type(__front_capacity + __back_capacity) < _S_buffer_size())
394 return std::__shrink_to_fit_aux<deque>::_S_do_it(*
this);
398 template <
typename _Tp,
typename _Alloc>
399 _GLIBCXX26_CONSTEXPR
void
406 for (__cur = this->_M_impl._M_start._M_node;
407 __cur < this->_M_impl._M_finish._M_node;
409 std::__uninitialized_fill_a(*__cur, *__cur + _S_buffer_size(),
410 __value, _M_get_Tp_allocator());
411 std::__uninitialized_fill_a(this->_M_impl._M_finish._M_first,
412 this->_M_impl._M_finish._M_cur,
413 __value, _M_get_Tp_allocator());
417 std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur),
418 _M_get_Tp_allocator());
419 __throw_exception_again;
423 template <
typename _Tp,
typename _Alloc>
424 template <
typename _InputIterator>
425 _GLIBCXX26_CONSTEXPR
void
430 this->_M_initialize_map(0);
433 for (; __first != __last; ++__first)
434#
if __cplusplus >= 201103L
435 emplace_back(*__first);
443 __throw_exception_again;
447 template <
typename _Tp,
typename _Alloc>
448 template <
typename _ForwardIterator>
449 _GLIBCXX26_CONSTEXPR
void
455 this->_M_initialize_map(_S_check_init_len(__n, _M_get_Tp_allocator()));
457 _Map_pointer __cur_node;
460 for (__cur_node = this->_M_impl._M_start._M_node;
461 __cur_node < this->_M_impl._M_finish._M_node;
464 if (__n < _S_buffer_size())
465 __builtin_unreachable();
467 _ForwardIterator __mid = __first;
469 std::__uninitialized_copy_a(__first, __mid, *__cur_node,
470 _M_get_Tp_allocator());
473 std::__uninitialized_copy_a(__first, __last,
474 this->_M_impl._M_finish._M_first,
475 _M_get_Tp_allocator());
480 iterator(*__cur_node, __cur_node),
481 _M_get_Tp_allocator());
482 __throw_exception_again;
487 template<
typename _Tp,
typename _Alloc>
488#if __cplusplus >= 201103L
489 template<
typename... _Args>
490 _GLIBCXX26_CONSTEXPR
void
500 __throw_length_error(
501 __N(
"cannot create std::deque larger than max_size()"));
504 *(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node();
507#if __cplusplus >= 201103L
508 _Alloc_traits::construct(this->_M_impl,
509 this->_M_impl._M_finish._M_cur,
512 this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __t);
514 this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node
516 this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first;
520 _M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1));
521 __throw_exception_again;
526 template<
typename _Tp,
typename _Alloc>
527#if __cplusplus >= 201103L
528 template<
typename... _Args>
529 _GLIBCXX26_CONSTEXPR
void
539 __throw_length_error(
540 __N(
"cannot create std::deque larger than max_size()"));
543 *(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
546 this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node
548 this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
549#if __cplusplus >= 201103L
550 _Alloc_traits::construct(this->_M_impl,
551 this->_M_impl._M_start._M_cur,
554 this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t);
559 ++this->_M_impl._M_start;
560 _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1));
561 __throw_exception_again;
566 template <
typename _Tp,
typename _Alloc>
567 _GLIBCXX26_CONSTEXPR
void
571 _M_deallocate_node(this->_M_impl._M_finish._M_first);
572 this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1);
573 this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1;
574 _Alloc_traits::destroy(_M_get_Tp_allocator(),
575 this->_M_impl._M_finish._M_cur);
583 template <
typename _Tp,
typename _Alloc>
584 _GLIBCXX26_CONSTEXPR
void
588 _Alloc_traits::destroy(_M_get_Tp_allocator(),
589 this->_M_impl._M_start._M_cur);
590 _M_deallocate_node(this->_M_impl._M_start._M_first);
591 this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1);
592 this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first;
595 template <
typename _Tp,
typename _Alloc>
596 template <
typename _InputIterator,
typename _Sentinel>
597 _GLIBCXX26_CONSTEXPR
void
602 iterator __new_start = _M_reserve_elements_at_front(__n);
605 std::__uninitialized_copy_a(_GLIBCXX_MOVE(__first), __last,
606 __new_start, _M_get_Tp_allocator());
607 this->_M_impl._M_start = __new_start;
611 _M_destroy_nodes(__new_start._M_node,
612 this->_M_impl._M_start._M_node);
613 __throw_exception_again;
617 template <
typename _Tp,
typename _Alloc>
618 template <
typename _InputIterator,
typename _Sentinel>
619 _GLIBCXX26_CONSTEXPR
void
624 iterator __new_finish = _M_reserve_elements_at_back(__n);
627 std::__uninitialized_copy_a(_GLIBCXX_MOVE(__first), __last,
628 this->_M_impl._M_finish,
629 _M_get_Tp_allocator());
630 this->_M_impl._M_finish = __new_finish;
634 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
635 __new_finish._M_node + 1);
636 __throw_exception_again;
640 template <
typename _Tp,
typename _Alloc>
641 template <
typename _InputIterator>
642 _GLIBCXX26_CONSTEXPR
void
645 _InputIterator __first, _InputIterator __last,
646 std::input_iterator_tag)
649 template <
typename _Tp,
typename _Alloc>
650 template <
typename _ForwardIterator>
651 _GLIBCXX26_CONSTEXPR
void
654 _ForwardIterator __first, _ForwardIterator __last,
655 std::forward_iterator_tag)
658 if (__builtin_expect(__n == 0, 0))
661 if (__pos._M_cur == this->_M_impl._M_start._M_cur)
662 _M_range_prepend(__first, __last, __n);
663 else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
664 _M_range_append(__first, __last, __n);
666 _M_insert_aux(__pos, __first, __last, __n);
669 template<
typename _Tp,
typename _Alloc>
670#if __cplusplus >= 201103L
671 template<
typename... _Args>
673 typename deque<_Tp, _Alloc>::iterator
682 typename deque<_Tp, _Alloc>::iterator
691 push_front(_GLIBCXX_MOVE(front()));
692 iterator __front1 = this->_M_impl._M_start;
696 __pos = this->_M_impl._M_start + __index;
699 _GLIBCXX_MOVE3(__front2, __pos1, __front1);
703 push_back(_GLIBCXX_MOVE(back()));
704 iterator __back1 = this->_M_impl._M_finish;
708 __pos = this->_M_impl._M_start + __index;
709 _GLIBCXX_MOVE_BACKWARD3(__pos, __back2, __back1);
711#if __cplusplus >= 201103L
719 template <
typename _Tp,
typename _Alloc>
720 _GLIBCXX26_CONSTEXPR
void
729 iterator __new_start = _M_reserve_elements_at_front(__n);
730 iterator __old_start = this->_M_impl._M_start;
731 __pos = this->_M_impl._M_start + __elems_before;
736 iterator __start_n = (this->_M_impl._M_start
738 std::__uninitialized_move_a(this->_M_impl._M_start,
739 __start_n, __new_start,
740 _M_get_Tp_allocator());
741 this->_M_impl._M_start = __new_start;
742 _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
747 std::__uninitialized_move_fill(this->_M_impl._M_start,
749 this->_M_impl._M_start,
751 _M_get_Tp_allocator());
752 this->_M_impl._M_start = __new_start;
753 std::fill(__old_start, __pos, __x_copy);
758 _M_destroy_nodes(__new_start._M_node,
759 this->_M_impl._M_start._M_node);
760 __throw_exception_again;
765 iterator __new_finish = _M_reserve_elements_at_back(__n);
766 iterator __old_finish = this->_M_impl._M_finish;
769 __pos = this->_M_impl._M_finish - __elems_after;
774 iterator __finish_n = (this->_M_impl._M_finish
776 std::__uninitialized_move_a(__finish_n,
777 this->_M_impl._M_finish,
778 this->_M_impl._M_finish,
779 _M_get_Tp_allocator());
780 this->_M_impl._M_finish = __new_finish;
781 _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
786 std::__uninitialized_fill_move(this->_M_impl._M_finish,
789 this->_M_impl._M_finish,
790 _M_get_Tp_allocator());
791 this->_M_impl._M_finish = __new_finish;
792 std::fill(__pos, __old_finish, __x_copy);
797 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
798 __new_finish._M_node + 1);
799 __throw_exception_again;
804 template <
typename _Tp,
typename _Alloc>
805 template <
typename _ForwardIterator>
806 _GLIBCXX26_CONSTEXPR
void
809 _ForwardIterator __first, _ForwardIterator __last,
814 if (
static_cast<size_type>(__elemsbefore) < __length / 2)
816 iterator __new_start = _M_reserve_elements_at_front(__n);
817 iterator __old_start = this->_M_impl._M_start;
818 __pos = this->_M_impl._M_start + __elemsbefore;
823 iterator __start_n = (this->_M_impl._M_start
825 std::__uninitialized_move_a(this->_M_impl._M_start,
826 __start_n, __new_start,
827 _M_get_Tp_allocator());
828 this->_M_impl._M_start = __new_start;
829 _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
834 _ForwardIterator __mid = __first;
836 std::__uninitialized_move_copy(this->_M_impl._M_start,
837 __pos, __first, __mid,
839 _M_get_Tp_allocator());
840 this->_M_impl._M_start = __new_start;
841 std::copy(__mid, __last, __old_start);
846 _M_destroy_nodes(__new_start._M_node,
847 this->_M_impl._M_start._M_node);
848 __throw_exception_again;
853 iterator __new_finish = _M_reserve_elements_at_back(__n);
854 iterator __old_finish = this->_M_impl._M_finish;
857 __pos = this->_M_impl._M_finish - __elemsafter;
862 iterator __finish_n = (this->_M_impl._M_finish
864 std::__uninitialized_move_a(__finish_n,
865 this->_M_impl._M_finish,
866 this->_M_impl._M_finish,
867 _M_get_Tp_allocator());
868 this->_M_impl._M_finish = __new_finish;
869 _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
870 std::copy(__first, __last, __pos);
874 _ForwardIterator __mid = __first;
876 std::__uninitialized_copy_move(__mid, __last, __pos,
877 this->_M_impl._M_finish,
878 this->_M_impl._M_finish,
879 _M_get_Tp_allocator());
880 this->_M_impl._M_finish = __new_finish;
881 std::copy(__first, __mid, __pos);
886 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
887 __new_finish._M_node + 1);
888 __throw_exception_again;
893#if __glibcxx_containers_ranges
894 template<ranges::forward_range _Rg>
895 _GLIBCXX26_CONSTEXPR
auto
896 __advance_dist(_Rg& __rg)
900 ranges::iterator_t<_Rg> __last;
901 ranges::range_difference_t<_Rg> __size;
904 return _Res{ranges::end(__rg), ranges::distance(__rg)};
907 auto const __n = ranges::distance(__rg);
908 auto __it = ranges::begin(__rg);
912 ranges::advance(__it, ranges::end(__rg));
913 return _Res{__it, __n};
917 auto __it = ranges::begin(__rg);
918 auto const __last = ranges::end(__rg);
919 ranges::range_difference_t<_Rg> __n(0);
920 for (; __it != __last; ++__it)
922 return _Res{__it, __n};
926 template<
typename _Tp,
typename _Alloc>
927 template<__detail::__container_compatible_range<_Tp> _Rg>
928 _GLIBCXX26_CONSTEXPR
auto
935 const auto __ins_idx =
size();
937 return begin() + __ins_idx;
946 const auto __ins_idx = __pos -
cbegin();
949 auto [__last, __n] = __advance_dist(__rg);
950 if (__n != 0) [[likely]]
951 _M_insert_aux(__pos._M_const_cast(),
952 ranges::begin(__rg), __last,
957 auto __first = ranges::begin(__rg);
958 const auto __last = ranges::end(__rg);
959 for (
auto __it = __pos._M_const_cast(); __first != __last;
960 (
void)++__first, ++__it)
961 __it = _M_emplace_aux(__it, *__first);
963 return begin() + __ins_idx;
966 template<
typename _Tp,
typename _Alloc>
967 template<__detail::__container_compatible_range<_Tp> _Rg>
968 _GLIBCXX26_CONSTEXPR
void
976 const size_type __n(ranges::distance(__rg));
977 if (__n != 0) [[likely]]
978 _M_range_prepend(ranges::begin(__rg), ranges::end(__rg), __n);
982 struct _Guard_elts_front
990 __self._M_erase_at_begin(__self.begin() + __n);
994 _Guard_elts_front __guard{*
this};
995 auto __first = ranges::begin(__rg);
996 const auto __last = ranges::end(__rg);
997 for (; __first != __last; (void)++__first, ++__guard.__n)
998 emplace_front(*__first);
1000 for (
auto __fins =
begin(), __lins =
begin() + __guard.__n;
1001 __fins != __lins && __fins != --__lins; ++__fins)
1002 std::iter_swap(__fins, __lins);
1008 template<
typename _Tp,
typename _Alloc>
1009 template<__detail::__container_compatible_range<_Tp> _Rg>
1010 _GLIBCXX26_CONSTEXPR
void
1016 const size_type __n(ranges::distance(__rg));
1017 if (__n != 0) [[likely]]
1018 _M_range_append(ranges::begin(__rg), ranges::end(__rg), __n);
1022 struct _Guard_elts_back
1025 size_type __n = __self.size();
1027 _GLIBCXX26_CONSTEXPR
1030 if (__n < __self.size())
1031 __self._M_erase_at_end(__self.begin() + __n);
1035 _Guard_elts_back __guard{*
this};
1036 auto __first = ranges::begin(__rg);
1037 const auto __last = ranges::end(__rg);
1038 for (; __first != __last; (void)++__first)
1039 emplace_back(*__first);
1041 __guard.__n =
size();
1046 template<
typename _Tp,
typename _Alloc>
1047 _GLIBCXX26_CONSTEXPR
void
1051 for (_Map_pointer __node = __first._M_node + 1;
1052 __node < __last._M_node; ++__node)
1054 _M_get_Tp_allocator());
1056 if (__first._M_node != __last._M_node)
1059 _M_get_Tp_allocator());
1061 _M_get_Tp_allocator());
1065 _M_get_Tp_allocator());
1068 template <
typename _Tp,
typename _Alloc>
1069 _GLIBCXX26_CONSTEXPR
void
1074 __throw_length_error(__N(
"deque::_M_new_elements_at_front"));
1076 const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
1077 / _S_buffer_size());
1082 for (__i = 1; __i <= __new_nodes; ++__i)
1083 *(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node();
1087 for (size_type __j = 1; __j < __i; ++__j)
1088 _M_deallocate_node(*(this->_M_impl._M_start._M_node - __j));
1089 __throw_exception_again;
1093 template <
typename _Tp,
typename _Alloc>
1094 _GLIBCXX26_CONSTEXPR
void
1099 __throw_length_error(__N(
"deque::_M_new_elements_at_back"));
1101 const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
1102 / _S_buffer_size());
1107 for (__i = 1; __i <= __new_nodes; ++__i)
1108 *(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node();
1112 for (size_type __j = 1; __j < __i; ++__j)
1113 _M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j));
1114 __throw_exception_again;
1118 template <
typename _Tp,
typename _Alloc>
1119 _GLIBCXX26_CONSTEXPR
void
1123 const size_type __old_num_nodes
1124 = this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1;
1125 const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
1127 _Map_pointer __new_nstart;
1128 if (this->_M_impl._M_map_size > 2 * __new_num_nodes)
1130 __new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size
1131 - __new_num_nodes) / 2
1132 + (__add_at_front ? __nodes_to_add : 0);
1133 if (__new_nstart < this->_M_impl._M_start._M_node)
1134 std::copy(this->_M_impl._M_start._M_node,
1135 this->_M_impl._M_finish._M_node + 1,
1138 std::copy_backward(this->_M_impl._M_start._M_node,
1139 this->_M_impl._M_finish._M_node + 1,
1140 __new_nstart + __old_num_nodes);
1144 size_type __new_map_size = this->_M_impl._M_map_size
1145 +
std::max(this->_M_impl._M_map_size,
1146 __nodes_to_add) + 2;
1148 const size_t __bufsz = __deque_buf_size(
sizeof(_Tp));
1149 if (__new_map_size > ((
max_size() + __bufsz - 1) / __bufsz) * 2)
1150 __builtin_unreachable();
1152 _Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
1153 __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
1154 + (__add_at_front ? __nodes_to_add : 0);
1155 std::copy(this->_M_impl._M_start._M_node,
1156 this->_M_impl._M_finish._M_node + 1,
1158 _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
1160 this->_M_impl._M_map = __new_map;
1161 this->_M_impl._M_map_size = __new_map_size;
1164 this->_M_impl._M_start._M_set_node(__new_nstart);
1165 this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
1168_GLIBCXX_END_NAMESPACE_CONTAINER
1172 template<
typename _Tp,
typename _VTp>
1173 _GLIBCXX26_CONSTEXPR
void
1174 __fill_a1(
const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
1175 const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>& __last,
1176 const _VTp& __value)
1178 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> _Iter;
1179 if (__first._M_node != __last._M_node)
1181 std::__fill_a1(__first._M_cur, __first._M_last, __value);
1183 for (
typename _Iter::_Map_pointer __node = __first._M_node + 1;
1184 __node < __last._M_node; ++__node)
1185 std::__fill_a1(*__node, *__node + _Iter::_S_buffer_size(), __value);
1187 std::__fill_a1(__last._M_first, __last._M_cur, __value);
1190 std::__fill_a1(__first._M_cur, __last._M_cur, __value);
1193 template<
bool _IsMove,
1194 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
1195 _GLIBCXX26_CONSTEXPR _OI
1196 __copy_move_dit(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first,
1197 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last,
1200 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> _Iter;
1201 if (__first._M_node != __last._M_node)
1204 = std::__copy_move_a1<_IsMove>(__first._M_cur, __first._M_last,
1207 for (
typename _Iter::_Map_pointer __node = __first._M_node + 1;
1208 __node != __last._M_node; ++__node)
1210 = std::__copy_move_a1<_IsMove>(*__node,
1211 *__node + _Iter::_S_buffer_size(),
1214 return std::__copy_move_a1<_IsMove>(__last._M_first, __last._M_cur,
1218 return std::__copy_move_a1<_IsMove>(__first._M_cur, __last._M_cur,
1222 template<
bool _IsMove,
1223 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
1224 _GLIBCXX26_CONSTEXPR _OI
1225 __copy_move_a1(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first,
1226 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last,
1228 {
return __copy_move_dit<_IsMove>(__first, __last, __result); }
1230 template<
bool _IsMove,
1231 typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp>
1232 _GLIBCXX26_CONSTEXPR
1233 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
1234 __copy_move_a1(_GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __first,
1235 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __last,
1236 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result)
1237 {
return __copy_move_dit<_IsMove>(__first, __last, __result); }
1239 template<
bool _IsMove,
typename _II,
typename _Tp>
1240 _GLIBCXX26_CONSTEXPR
1241 typename __gnu_cxx::__enable_if<
1242 __is_any_random_access_iter<_II>::__value,
1243 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type
1244 __copy_move_a1(_II __first, _II __last,
1245 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> __result)
1247 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> _Iter;
1254 =
std::min(__len, __result._M_last - __result._M_cur);
1255 std::__copy_move_a1<_IsMove>(__first, __first + __clen,
1266 template<
bool _IsMove,
typename _CharT>
1267 _GLIBCXX26_CONSTEXPR
1268 typename __gnu_cxx::__enable_if<
1269 __is_char<_CharT>::__value,
1270 _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> >::__type
1274 _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> __result)
1276 if (__first == __last)
1281 const std::ptrdiff_t __len = __result._M_last - __result._M_cur;
1282 const std::ptrdiff_t __nb
1283 = std::__copy_n_a(__first, __len, __result._M_cur,
false)
1294 template<
typename _CharT,
typename _Size>
1295 _GLIBCXX26_CONSTEXPR
1296 typename __gnu_cxx::__enable_if<
1297 __is_char<_CharT>::__value,
1298 _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> >::__type
1301 _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> __result,
1311 std::__copy_n_a(__it, __len, __result._M_cur, __strict);
1315 while (__size != 0);
1319 template<
bool _IsMove,
1320 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
1321 _GLIBCXX26_CONSTEXPR _OI
1322 __copy_move_backward_dit(
1323 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first,
1324 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last,
1327 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> _Iter;
1328 if (__first._M_node != __last._M_node)
1330 __result = std::__copy_move_backward_a1<_IsMove>(
1331 __last._M_first, __last._M_cur, __result);
1333 for (
typename _Iter::_Map_pointer __node = __last._M_node - 1;
1334 __node != __first._M_node; --__node)
1335 __result = std::__copy_move_backward_a1<_IsMove>(
1336 *__node, *__node + _Iter::_S_buffer_size(), __result);
1338 return std::__copy_move_backward_a1<_IsMove>(
1339 __first._M_cur, __first._M_last, __result);
1342 return std::__copy_move_backward_a1<_IsMove>(
1343 __first._M_cur, __last._M_cur, __result);
1346 template<
bool _IsMove,
1347 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
1348 _GLIBCXX26_CONSTEXPR _OI
1349 __copy_move_backward_a1(
1350 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first,
1351 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last,
1353 {
return __copy_move_backward_dit<_IsMove>(__first, __last, __result); }
1355 template<
bool _IsMove,
1356 typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp>
1357 _GLIBCXX26_CONSTEXPR
1358 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
1359 __copy_move_backward_a1(
1360 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __first,
1361 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __last,
1362 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result)
1363 {
return __copy_move_backward_dit<_IsMove>(__first, __last, __result); }
1365 template<
bool _IsMove,
typename _II,
typename _Tp>
1366 _GLIBCXX26_CONSTEXPR
1367 typename __gnu_cxx::__enable_if<
1368 __is_any_random_access_iter<_II>::__value,
1369 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type
1370 __copy_move_backward_a1(_II __first, _II __last,
1371 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> __result)
1373 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> _Iter;
1380 _Tp* __rend = __result._M_cur;
1383 __rlen = _Iter::_S_buffer_size();
1384 __rend = *(__result._M_node - 1) + __rlen;
1388 std::__copy_move_backward_a1<_IsMove>(__last - __clen, __last, __rend);
1398 template<
typename _Tp,
typename _Ref,
typename _Ptr,
typename _II>
1399 _GLIBCXX26_CONSTEXPR
bool
1401 const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>& __first1,
1402 const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>& __last1,
1405 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> _Iter;
1406 if (__first1._M_node != __last1._M_node)
1408 if (!std::__equal_aux1(__first1._M_cur, __first1._M_last, __first2))
1411 __first2 += __first1._M_last - __first1._M_cur;
1412 for (
typename _Iter::_Map_pointer __node = __first1._M_node + 1;
1413 __node != __last1._M_node;
1414 __first2 += _Iter::_S_buffer_size(), ++__node)
1415 if (!std::__equal_aux1(*__node, *__node + _Iter::_S_buffer_size(),
1419 return std::__equal_aux1(__last1._M_first, __last1._M_cur, __first2);
1422 return std::__equal_aux1(__first1._M_cur, __last1._M_cur, __first2);
1425 template<
typename _Tp,
typename _Ref,
typename _Ptr,
typename _II>
1426 _GLIBCXX26_CONSTEXPR
1427 typename __gnu_cxx::__enable_if<
1428 __is_any_random_access_iter<_II>::__value,
bool>::__type
1429 __equal_aux1(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first1,
1430 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __last1,
1432 {
return std::__equal_dit(__first1, __last1, __first2); }
1434 template<
typename _Tp1,
typename _Ref1,
typename _Ptr1,
1435 typename _Tp2,
typename _Ref2,
typename _Ptr2>
1436 _GLIBCXX26_CONSTEXPR
bool
1437 __equal_aux1(_GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __first1,
1438 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __last1,
1439 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __first2)
1440 {
return std::__equal_dit(__first1, __last1, __first2); }
1442 template<
typename _II,
typename _Tp,
typename _Ref,
typename _Ptr>
1443 _GLIBCXX26_CONSTEXPR
1444 typename __gnu_cxx::__enable_if<
1445 __is_any_random_access_iter<_II>::__value,
bool>::__type
1446 __equal_aux1(_II __first1, _II __last1,
1447 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> __first2)
1449 typedef _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr> _Iter;
1456 =
std::min(__len, __first2._M_last - __first2._M_cur);
1457 if (!std::__equal_aux1(__first1, __first1 + __clen, __first2._M_cur))
1468 template<
typename _Tp1,
typename _Ref,
typename _Ptr,
typename _Tp2>
1469 _GLIBCXX26_CONSTEXPR
int
1471 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref, _Ptr> __first1,
1472 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref, _Ptr> __last1,
1473 const _Tp2* __first2,
const _Tp2* __last2)
1475#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
1476 const bool __simple =
1477 (__is_memcmp_ordered_with<_Tp1, _Tp2>::__value
1478 && __is_pointer(_Ptr)
1479#if __cplusplus > 201703L && __cpp_lib_concepts
1483 && !is_volatile_v<_Tp1> && !is_volatile_v<_Tp2>
1486 typedef std::__lexicographical_compare<__simple> _Lc;
1488 typedef std::__lexicographical_compare<false> _Lc;
1491 while (__first1._M_node != __last1._M_node)
1493 const ptrdiff_t __len1 = __first1._M_last - __first1._M_cur;
1494 const ptrdiff_t __len2 = __last2 - __first2;
1495 const ptrdiff_t __len =
std::min(__len1, __len2);
1497 if (
int __ret = _Lc::__3way(__first1._M_cur, __first1._M_last,
1498 __first2, __first2 + __len))
1504 return _Lc::__3way(__first1._M_cur, __last1._M_cur,
1508 template<
typename _Tp1,
typename _Ref1,
typename _Ptr1,
1510 inline _GLIBCXX26_CONSTEXPR
bool
1511 __lexicographical_compare_aux1(
1512 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __first1,
1513 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __last1,
1514 _Tp2* __first2, _Tp2* __last2)
1515 {
return std::__lex_cmp_dit(__first1, __last1, __first2, __last2) < 0; }
1517 template<
typename _Tp1,
1518 typename _Tp2,
typename _Ref2,
typename _Ptr2>
1519 inline _GLIBCXX26_CONSTEXPR
bool
1520 __lexicographical_compare_aux1(_Tp1* __first1, _Tp1* __last1,
1521 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __first2,
1522 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __last2)
1523 {
return std::__lex_cmp_dit(__first2, __last2, __first1, __last1) > 0; }
1525 template<
typename _Tp1,
typename _Ref1,
typename _Ptr1,
1526 typename _Tp2,
typename _Ref2,
typename _Ptr2>
1527 inline _GLIBCXX26_CONSTEXPR
bool
1528 __lexicographical_compare_aux1(
1529 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __first1,
1530 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1> __last1,
1531 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __first2,
1532 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2> __last2)
1534#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
1535 const bool __simple =
1536 (__is_memcmp_ordered_with<_Tp1, _Tp2>::__value
1537 && __is_pointer(_Ptr1) && __is_pointer(_Ptr2)
1538#if __cplusplus > 201703L && __cpp_lib_concepts
1542 && !is_volatile_v<_Tp1> && !is_volatile_v<_Tp2>
1545 typedef std::__lexicographical_compare<__simple> _Lc;
1547 typedef std::__lexicographical_compare<false> _Lc;
1550 while (__first1 != __last1)
1552 const ptrdiff_t __len2 = __first2._M_node == __last2._M_node
1553 ? __last2._M_cur - __first2._M_cur
1554 : __first2._M_last - __first2._M_cur;
1557 const ptrdiff_t __len1 = __first1._M_node == __last1._M_node
1558 ? __last1._M_cur - __first1._M_cur
1559 : __first1._M_last - __first1._M_cur;
1560 const ptrdiff_t __len =
std::min(__len1, __len2);
1561 if (
int __ret = _Lc::__3way(__first1._M_cur, __first1._M_cur + __len,
1562 __first2._M_cur, __first2._M_cur + __len))
1569 return __last2 != __first2;
1572#if __cplusplus >= 201103L
1573#pragma GCC diagnostic push
1574#pragma GCC diagnostic ignored "-Wc++17-extensions"
1575 template<
typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp,
1577 _GLIBCXX26_CONSTEXPR
1578 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
1579 __uninitialized_copy_a(
1580 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __first,
1581 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __last,
1582 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result,
1587 if constexpr (!__is_nothrow_constructible(_OTp, _IRef))
1588 return std::__do_uninit_copy(__first, __last, __result);
1590 while (__first != __last)
1592 auto __from = __first._M_cur;
1594 if (__first._M_node == __last._M_node)
1595 __n = __last._M_cur - __from;
1597 __n = __first._M_last - __from;
1606 template<
typename _Iter,
typename _OTp,
typename _Tp>
1607 _GLIBCXX26_CONSTEXPR
1608 __enable_if_t<__is_random_access_iter<_Iter>::value,
1609 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>>
1610 __uninitialized_copy_a(_Iter __first, _Iter __last,
1611 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result,
1616 if constexpr (!__is_nothrow_constructible(_OTp,
decltype(*__first)))
1617 return std::__do_uninit_copy(__first, __last, __result);
1619 while (__first != __last)
1622 __result._M_last - __result._M_cur);
1630 template<
typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp,
1632 _GLIBCXX26_CONSTEXPR
1633 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
1634 __uninitialized_move_a(
1635 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __first,
1636 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr> __last,
1637 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*> __result,
1642 if constexpr (!__is_nothrow_constructible(_OTp,
1645 std::make_move_iterator(__last),
1648 while (__first != __last)
1650 auto __from = __first._M_cur;
1652 if (__first._M_node == __last._M_node)
1653 __n = __last._M_cur - __from;
1655 __n = __first._M_last - __from;
1658 std::make_move_iterator(__from + __n),
1665#pragma GCC diagnostic pop
1668_GLIBCXX_END_NAMESPACE_VERSION
constexpr _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.
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 insert_iterator< _Container > inserter(_Container &__x, std::__detail::__range_iter_t< _Container > __i)
ISO C++ entities toplevel namespace is std.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
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 end(_Container &__cont) noexcept(noexcept(__cont.end())) -> decltype(__cont.end())
Return an iterator pointing to one past the last element of the container.
constexpr auto empty(const _Container &__cont) noexcept(noexcept(__cont.empty())) -> decltype(__cont.empty())
Return whether a container is empty.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
constexpr void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
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.
constexpr void _Destroy(_ForwardIterator __first, _ForwardIterator __last)
constexpr auto begin(_Container &__cont) noexcept(noexcept(__cont.begin())) -> decltype(__cont.begin())
Return an iterator pointing to the first element of the container.
The standard allocator, as per C++03 [20.4.1].
Basis for explicit traits specializations.
Provides input iterator semantics for streambufs.
A standard container using fixed-size memory allocation and constant-time manipulation of elements at...
constexpr void push_front(const value_type &__x)
Add data to the front of the deque.
constexpr void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)
Memory-handling helpers for the major map.
constexpr void _M_reserve_map_at_front(size_type __nodes_to_add=1)
Memory-handling helpers for the major map.
constexpr void _M_new_elements_at_back(size_type __new_elements)
Memory-handling helpers for the previous internal insert functions.
constexpr size_type max_size() const noexcept
constexpr void _M_reserve_map_at_back(size_type __nodes_to_add=1)
Memory-handling helpers for the major map.
constexpr void _M_pop_front_aux()
Helper functions for push_* and pop_*.
constexpr void _M_fill_initialize(const value_type &__value)
Fills the deque with copies of value.
constexpr size_type size() const noexcept
constexpr void _M_range_initialize(_InputIterator __first, _InputIterator __last, std::input_iterator_tag)
Fills the deque with whatever is in [first,last).
constexpr void _M_new_elements_at_front(size_type __new_elements)
Memory-handling helpers for the previous internal insert functions.
constexpr deque & operator=(const deque &__x)
Deque assignment operator.
deque()=default
Creates a deque with no elements.
constexpr void push_back(const value_type &__x)
Add data to the end of the deque.
constexpr iterator end() noexcept
constexpr void _M_pop_back_aux()
Helper functions for push_* and pop_*.
constexpr void clear() noexcept
constexpr allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
constexpr iterator begin() noexcept
constexpr void _M_push_front_aux(_Args &&... __args)
Helper functions for push_* and pop_*.
constexpr iterator insert(const_iterator __position, const value_type &__x)
Inserts given value into deque before specified iterator.
constexpr iterator emplace(const_iterator __position, _Args &&... __args)
Inserts an object in deque before specified iterator.
constexpr void _M_push_back_aux(_Args &&... __args)
Helper functions for push_* and pop_*.
Forward iterators support a superset of input iterator operations.
Random-access iterators support a superset of bidirectional iterator operations.
[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.
A range for which ranges::begin and ranges::end return the same type.