59 namespace std _GLIBCXX_VISIBILITY(default)
61 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
63 #if __cplusplus >= 201103L 64 template <
typename _Tp,
typename _Alloc>
67 _M_default_initialize()
72 for (__cur = this->_M_impl._M_start._M_node;
73 __cur < this->_M_impl._M_finish._M_node;
75 std::__uninitialized_default_a(*__cur, *__cur + _S_buffer_size(),
76 _M_get_Tp_allocator());
77 std::__uninitialized_default_a(this->_M_impl._M_finish._M_first,
78 this->_M_impl._M_finish._M_cur,
79 _M_get_Tp_allocator());
83 std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur),
84 _M_get_Tp_allocator());
85 __throw_exception_again;
90 template <
typename _Tp,
typename _Alloc>
97 #if __cplusplus >= 201103L 98 if (_Alloc_traits::_S_propagate_on_copy_assign())
100 if (!_Alloc_traits::_S_always_equal()
101 && _M_get_Tp_allocator() != __x._M_get_Tp_allocator())
106 std::__alloc_on_copy(_M_get_Tp_allocator(),
107 __x._M_get_Tp_allocator());
110 std::__alloc_on_copy(_M_get_Tp_allocator(),
111 __x._M_get_Tp_allocator());
114 const size_type __len = size();
115 if (__len >= __x.
size())
116 _M_erase_at_end(std::copy(__x.
begin(), __x.
end(),
117 this->_M_impl._M_start));
121 std::copy(__x.
begin(), __mid, this->_M_impl._M_start);
122 _M_range_insert_aux(this->_M_impl._M_finish, __mid, __x.
end(),
129 #if __cplusplus >= 201103L 130 template<
typename _Tp,
typename _Alloc>
131 template<
typename... _Args>
132 #if __cplusplus > 201402L 133 typename deque<_Tp, _Alloc>::reference
140 if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
142 _Alloc_traits::construct(this->_M_impl,
143 this->_M_impl._M_start._M_cur - 1,
144 std::forward<_Args>(__args)...);
145 --this->_M_impl._M_start._M_cur;
148 _M_push_front_aux(std::forward<_Args>(__args)...);
149 #if __cplusplus > 201402L 154 template<
typename _Tp,
typename _Alloc>
155 template<
typename... _Args>
156 #if __cplusplus > 201402L 157 typename deque<_Tp, _Alloc>::reference
164 if (this->_M_impl._M_finish._M_cur
165 != this->_M_impl._M_finish._M_last - 1)
167 _Alloc_traits::construct(this->_M_impl,
168 this->_M_impl._M_finish._M_cur,
169 std::forward<_Args>(__args)...);
170 ++this->_M_impl._M_finish._M_cur;
173 _M_push_back_aux(std::forward<_Args>(__args)...);
174 #if __cplusplus > 201402L 180 #if __cplusplus >= 201103L 181 template<
typename _Tp,
typename _Alloc>
182 template<
typename... _Args>
187 if (__position._M_cur == this->_M_impl._M_start._M_cur)
189 emplace_front(std::forward<_Args>(__args)...);
190 return this->_M_impl._M_start;
192 else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
194 emplace_back(std::forward<_Args>(__args)...);
195 iterator __tmp = this->_M_impl._M_finish;
200 return _M_insert_aux(__position._M_const_cast(),
201 std::forward<_Args>(__args)...);
205 template <
typename _Tp,
typename _Alloc>
208 #if __cplusplus >= 201103L 211 insert(
iterator __position,
const value_type& __x)
214 if (__position._M_cur == this->_M_impl._M_start._M_cur)
217 return this->_M_impl._M_start;
219 else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
222 iterator __tmp = this->_M_impl._M_finish;
227 return _M_insert_aux(__position._M_const_cast(), __x);
230 template <
typename _Tp,
typename _Alloc>
237 const difference_type __index = __position -
begin();
238 if (static_cast<size_type>(__index) < (size() >> 1))
240 if (__position !=
begin())
241 _GLIBCXX_MOVE_BACKWARD3(
begin(), __position, __next);
247 _GLIBCXX_MOVE3(__next,
end(), __position);
250 return begin() + __index;
253 template <
typename _Tp,
typename _Alloc>
258 if (__first == __last)
260 else if (__first ==
begin() && __last ==
end())
267 const difference_type __n = __last - __first;
268 const difference_type __elems_before = __first -
begin();
269 if (static_cast<size_type>(__elems_before) <= (size() - __n) / 2)
271 if (__first !=
begin())
272 _GLIBCXX_MOVE_BACKWARD3(
begin(), __first, __last);
273 _M_erase_at_begin(
begin() + __n);
278 _GLIBCXX_MOVE3(__last,
end(), __first);
279 _M_erase_at_end(
end() - __n);
281 return begin() + __elems_before;
285 template <
typename _Tp,
class _Alloc>
286 template <
typename _InputIterator>
293 for (; __first != __last && __cur !=
end(); ++__cur, ++__first)
295 if (__first == __last)
296 _M_erase_at_end(__cur);
298 _M_range_insert_aux(
end(), __first, __last,
302 template <
typename _Tp,
typename _Alloc>
307 if (__pos._M_cur == this->_M_impl._M_start._M_cur)
309 iterator __new_start = _M_reserve_elements_at_front(__n);
312 std::__uninitialized_fill_a(__new_start, this->_M_impl._M_start,
313 __x, _M_get_Tp_allocator());
314 this->_M_impl._M_start = __new_start;
318 _M_destroy_nodes(__new_start._M_node,
319 this->_M_impl._M_start._M_node);
320 __throw_exception_again;
323 else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
325 iterator __new_finish = _M_reserve_elements_at_back(__n);
328 std::__uninitialized_fill_a(this->_M_impl._M_finish,
330 _M_get_Tp_allocator());
331 this->_M_impl._M_finish = __new_finish;
335 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
336 __new_finish._M_node + 1);
337 __throw_exception_again;
341 _M_insert_aux(__pos, __n, __x);
344 #if __cplusplus >= 201103L 345 template <
typename _Tp,
typename _Alloc>
352 iterator __new_finish = _M_reserve_elements_at_back(__n);
355 std::__uninitialized_default_a(this->_M_impl._M_finish,
357 _M_get_Tp_allocator());
358 this->_M_impl._M_finish = __new_finish;
362 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
363 __new_finish._M_node + 1);
364 __throw_exception_again;
369 template <
typename _Tp,
typename _Alloc>
374 const difference_type __front_capacity
375 = (this->_M_impl._M_start._M_cur - this->_M_impl._M_start._M_first);
376 if (__front_capacity == 0)
379 const difference_type __back_capacity
380 = (this->_M_impl._M_finish._M_last - this->_M_impl._M_finish._M_cur);
381 if (__front_capacity + __back_capacity < _S_buffer_size())
384 return std::__shrink_to_fit_aux<deque>::_S_do_it(*
this);
388 template <
typename _Tp,
typename _Alloc>
396 for (__cur = this->_M_impl._M_start._M_node;
397 __cur < this->_M_impl._M_finish._M_node;
399 std::__uninitialized_fill_a(*__cur, *__cur + _S_buffer_size(),
400 __value, _M_get_Tp_allocator());
401 std::__uninitialized_fill_a(this->_M_impl._M_finish._M_first,
402 this->_M_impl._M_finish._M_cur,
403 __value, _M_get_Tp_allocator());
408 _M_get_Tp_allocator());
409 __throw_exception_again;
413 template <
typename _Tp,
typename _Alloc>
414 template <
typename _InputIterator>
420 this->_M_initialize_map(0);
423 for (; __first != __last; ++__first)
424 #
if __cplusplus >= 201103L
425 emplace_back(*__first);
433 __throw_exception_again;
437 template <
typename _Tp,
typename _Alloc>
438 template <
typename _ForwardIterator>
445 this->_M_initialize_map(__n);
447 _Map_pointer __cur_node;
450 for (__cur_node = this->_M_impl._M_start._M_node;
451 __cur_node < this->_M_impl._M_finish._M_node;
454 _ForwardIterator __mid = __first;
456 std::__uninitialized_copy_a(__first, __mid, *__cur_node,
457 _M_get_Tp_allocator());
460 std::__uninitialized_copy_a(__first, __last,
461 this->_M_impl._M_finish._M_first,
462 _M_get_Tp_allocator());
468 _M_get_Tp_allocator());
469 __throw_exception_again;
474 template<
typename _Tp,
typename _Alloc>
475 #if __cplusplus >= 201103L 476 template<
typename... _Args>
486 _M_reserve_map_at_back();
487 *(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node();
490 #if __cplusplus >= 201103L 491 _Alloc_traits::construct(this->_M_impl,
492 this->_M_impl._M_finish._M_cur,
493 std::forward<_Args>(__args)...);
495 this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __t);
497 this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node
499 this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first;
503 _M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1));
504 __throw_exception_again;
509 template<
typename _Tp,
typename _Alloc>
510 #if __cplusplus >= 201103L 511 template<
typename... _Args>
521 _M_reserve_map_at_front();
522 *(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
525 this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node
527 this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
528 #if __cplusplus >= 201103L 529 _Alloc_traits::construct(this->_M_impl,
530 this->_M_impl._M_start._M_cur,
531 std::forward<_Args>(__args)...);
533 this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t);
538 ++this->_M_impl._M_start;
539 _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1));
540 __throw_exception_again;
545 template <
typename _Tp,
typename _Alloc>
549 _M_deallocate_node(this->_M_impl._M_finish._M_first);
550 this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1);
551 this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1;
552 _Alloc_traits::destroy(_M_get_Tp_allocator(),
553 this->_M_impl._M_finish._M_cur);
561 template <
typename _Tp,
typename _Alloc>
565 _Alloc_traits::destroy(_M_get_Tp_allocator(),
566 this->_M_impl._M_start._M_cur);
567 _M_deallocate_node(this->_M_impl._M_start._M_first);
568 this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1);
569 this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first;
572 template <
typename _Tp,
typename _Alloc>
573 template <
typename _InputIterator>
577 _InputIterator __first, _InputIterator __last,
581 template <
typename _Tp,
typename _Alloc>
582 template <
typename _ForwardIterator>
586 _ForwardIterator __first, _ForwardIterator __last,
590 if (__pos._M_cur == this->_M_impl._M_start._M_cur)
592 iterator __new_start = _M_reserve_elements_at_front(__n);
595 std::__uninitialized_copy_a(__first, __last, __new_start,
596 _M_get_Tp_allocator());
597 this->_M_impl._M_start = __new_start;
601 _M_destroy_nodes(__new_start._M_node,
602 this->_M_impl._M_start._M_node);
603 __throw_exception_again;
606 else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
608 iterator __new_finish = _M_reserve_elements_at_back(__n);
611 std::__uninitialized_copy_a(__first, __last,
612 this->_M_impl._M_finish,
613 _M_get_Tp_allocator());
614 this->_M_impl._M_finish = __new_finish;
618 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
619 __new_finish._M_node + 1);
620 __throw_exception_again;
624 _M_insert_aux(__pos, __first, __last, __n);
627 template<
typename _Tp,
typename _Alloc>
628 #if __cplusplus >= 201103L 629 template<
typename... _Args>
634 value_type __x_copy(std::forward<_Args>(__args)...);
640 value_type __x_copy = __x;
642 difference_type __index = __pos - this->_M_impl._M_start;
643 if (static_cast<size_type>(__index) < size() / 2)
645 push_front(_GLIBCXX_MOVE(front()));
646 iterator __front1 = this->_M_impl._M_start;
650 __pos = this->_M_impl._M_start + __index;
653 _GLIBCXX_MOVE3(__front2, __pos1, __front1);
657 push_back(_GLIBCXX_MOVE(back()));
658 iterator __back1 = this->_M_impl._M_finish;
662 __pos = this->_M_impl._M_start + __index;
663 _GLIBCXX_MOVE_BACKWARD3(__pos, __back2, __back1);
665 *__pos = _GLIBCXX_MOVE(__x_copy);
669 template <
typename _Tp,
typename _Alloc>
674 const difference_type __elems_before = __pos - this->_M_impl._M_start;
675 const size_type __length = this->size();
676 value_type __x_copy = __x;
677 if (__elems_before < difference_type(__length / 2))
679 iterator __new_start = _M_reserve_elements_at_front(__n);
680 iterator __old_start = this->_M_impl._M_start;
681 __pos = this->_M_impl._M_start + __elems_before;
684 if (__elems_before >= difference_type(__n))
686 iterator __start_n = (this->_M_impl._M_start
687 + difference_type(__n));
688 std::__uninitialized_move_a(this->_M_impl._M_start,
689 __start_n, __new_start,
690 _M_get_Tp_allocator());
691 this->_M_impl._M_start = __new_start;
692 _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
693 std::fill(__pos - difference_type(__n), __pos, __x_copy);
697 std::__uninitialized_move_fill(this->_M_impl._M_start,
699 this->_M_impl._M_start,
701 _M_get_Tp_allocator());
702 this->_M_impl._M_start = __new_start;
703 std::fill(__old_start, __pos, __x_copy);
708 _M_destroy_nodes(__new_start._M_node,
709 this->_M_impl._M_start._M_node);
710 __throw_exception_again;
715 iterator __new_finish = _M_reserve_elements_at_back(__n);
716 iterator __old_finish = this->_M_impl._M_finish;
717 const difference_type __elems_after =
718 difference_type(__length) - __elems_before;
719 __pos = this->_M_impl._M_finish - __elems_after;
722 if (__elems_after > difference_type(__n))
724 iterator __finish_n = (this->_M_impl._M_finish
725 - difference_type(__n));
726 std::__uninitialized_move_a(__finish_n,
727 this->_M_impl._M_finish,
728 this->_M_impl._M_finish,
729 _M_get_Tp_allocator());
730 this->_M_impl._M_finish = __new_finish;
731 _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
732 std::fill(__pos, __pos + difference_type(__n), __x_copy);
736 std::__uninitialized_fill_move(this->_M_impl._M_finish,
737 __pos + difference_type(__n),
739 this->_M_impl._M_finish,
740 _M_get_Tp_allocator());
741 this->_M_impl._M_finish = __new_finish;
742 std::fill(__pos, __old_finish, __x_copy);
747 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
748 __new_finish._M_node + 1);
749 __throw_exception_again;
754 template <
typename _Tp,
typename _Alloc>
755 template <
typename _ForwardIterator>
759 _ForwardIterator __first, _ForwardIterator __last,
762 const difference_type __elemsbefore = __pos - this->_M_impl._M_start;
763 const size_type __length = size();
764 if (static_cast<size_type>(__elemsbefore) < __length / 2)
766 iterator __new_start = _M_reserve_elements_at_front(__n);
767 iterator __old_start = this->_M_impl._M_start;
768 __pos = this->_M_impl._M_start + __elemsbefore;
771 if (__elemsbefore >= difference_type(__n))
773 iterator __start_n = (this->_M_impl._M_start
774 + difference_type(__n));
775 std::__uninitialized_move_a(this->_M_impl._M_start,
776 __start_n, __new_start,
777 _M_get_Tp_allocator());
778 this->_M_impl._M_start = __new_start;
779 _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
780 std::copy(__first, __last, __pos - difference_type(__n));
784 _ForwardIterator __mid = __first;
785 std::advance(__mid, difference_type(__n) - __elemsbefore);
786 std::__uninitialized_move_copy(this->_M_impl._M_start,
787 __pos, __first, __mid,
789 _M_get_Tp_allocator());
790 this->_M_impl._M_start = __new_start;
791 std::copy(__mid, __last, __old_start);
796 _M_destroy_nodes(__new_start._M_node,
797 this->_M_impl._M_start._M_node);
798 __throw_exception_again;
803 iterator __new_finish = _M_reserve_elements_at_back(__n);
804 iterator __old_finish = this->_M_impl._M_finish;
805 const difference_type __elemsafter =
806 difference_type(__length) - __elemsbefore;
807 __pos = this->_M_impl._M_finish - __elemsafter;
810 if (__elemsafter > difference_type(__n))
812 iterator __finish_n = (this->_M_impl._M_finish
813 - difference_type(__n));
814 std::__uninitialized_move_a(__finish_n,
815 this->_M_impl._M_finish,
816 this->_M_impl._M_finish,
817 _M_get_Tp_allocator());
818 this->_M_impl._M_finish = __new_finish;
819 _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
820 std::copy(__first, __last, __pos);
824 _ForwardIterator __mid = __first;
826 std::__uninitialized_copy_move(__mid, __last, __pos,
827 this->_M_impl._M_finish,
828 this->_M_impl._M_finish,
829 _M_get_Tp_allocator());
830 this->_M_impl._M_finish = __new_finish;
831 std::copy(__first, __mid, __pos);
836 _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
837 __new_finish._M_node + 1);
838 __throw_exception_again;
843 template<
typename _Tp,
typename _Alloc>
848 for (_Map_pointer __node = __first._M_node + 1;
849 __node < __last._M_node; ++__node)
851 _M_get_Tp_allocator());
853 if (__first._M_node != __last._M_node)
856 _M_get_Tp_allocator());
858 _M_get_Tp_allocator());
862 _M_get_Tp_allocator());
865 template <
typename _Tp,
typename _Alloc>
870 if (this->max_size() - this->size() < __new_elems)
871 __throw_length_error(__N(
"deque::_M_new_elements_at_front"));
873 const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
875 _M_reserve_map_at_front(__new_nodes);
879 for (__i = 1; __i <= __new_nodes; ++__i)
880 *(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node();
884 for (size_type __j = 1; __j < __i; ++__j)
885 _M_deallocate_node(*(this->_M_impl._M_start._M_node - __j));
886 __throw_exception_again;
890 template <
typename _Tp,
typename _Alloc>
895 if (this->max_size() - this->size() < __new_elems)
896 __throw_length_error(__N(
"deque::_M_new_elements_at_back"));
898 const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
900 _M_reserve_map_at_back(__new_nodes);
904 for (__i = 1; __i <= __new_nodes; ++__i)
905 *(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node();
909 for (size_type __j = 1; __j < __i; ++__j)
910 _M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j));
911 __throw_exception_again;
915 template <
typename _Tp,
typename _Alloc>
920 const size_type __old_num_nodes
921 = this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1;
922 const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
924 _Map_pointer __new_nstart;
925 if (this->_M_impl._M_map_size > 2 * __new_num_nodes)
927 __new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size
928 - __new_num_nodes) / 2
929 + (__add_at_front ? __nodes_to_add : 0);
930 if (__new_nstart < this->_M_impl._M_start._M_node)
931 std::copy(this->_M_impl._M_start._M_node,
932 this->_M_impl._M_finish._M_node + 1,
935 std::copy_backward(this->_M_impl._M_start._M_node,
936 this->_M_impl._M_finish._M_node + 1,
937 __new_nstart + __old_num_nodes);
941 size_type __new_map_size = this->_M_impl._M_map_size
942 +
std::max(this->_M_impl._M_map_size,
945 _Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
946 __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
947 + (__add_at_front ? __nodes_to_add : 0);
948 std::copy(this->_M_impl._M_start._M_node,
949 this->_M_impl._M_finish._M_node + 1,
951 _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
953 this->_M_impl._M_map = __new_map;
954 this->_M_impl._M_map_size = __new_map_size;
957 this->_M_impl._M_start._M_set_node(__new_nstart);
958 this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
963 template<
typename _Tp>
970 for (
typename _Self::_Map_pointer __node = __first._M_node + 1;
971 __node < __last._M_node; ++__node)
972 std::fill(*__node, *__node + _Self::_S_buffer_size(), __value);
974 if (__first._M_node != __last._M_node)
976 std::fill(__first._M_cur, __first._M_last, __value);
977 std::fill(__last._M_first, __last._M_cur, __value);
980 std::fill(__first._M_cur, __last._M_cur, __value);
983 template<
typename _Tp>
990 typedef typename _Self::difference_type difference_type;
992 difference_type __len = __last - __first;
995 const difference_type __clen
997 __result._M_last - __result._M_cur));
998 std::copy(__first._M_cur, __first._M_cur + __clen, __result._M_cur);
1006 template<
typename _Tp>
1013 typedef typename _Self::difference_type difference_type;
1015 difference_type __len = __last - __first;
1018 difference_type __llen = __last._M_cur - __last._M_first;
1019 _Tp* __lend = __last._M_cur;
1021 difference_type __rlen = __result._M_cur - __result._M_first;
1022 _Tp* __rend = __result._M_cur;
1026 __llen = _Self::_S_buffer_size();
1027 __lend = *(__last._M_node - 1) + __llen;
1031 __rlen = _Self::_S_buffer_size();
1032 __rend = *(__result._M_node - 1) + __rlen;
1035 const difference_type __clen =
std::min(__len,
1037 std::copy_backward(__lend - __clen, __lend, __rend);
1045 #if __cplusplus >= 201103L 1046 template<
typename _Tp>
1053 typedef typename _Self::difference_type difference_type;
1055 difference_type __len = __last - __first;
1058 const difference_type __clen
1060 __result._M_last - __result._M_cur));
1061 std::move(__first._M_cur, __first._M_cur + __clen, __result._M_cur);
1069 template<
typename _Tp>
1076 typedef typename _Self::difference_type difference_type;
1078 difference_type __len = __last - __first;
1081 difference_type __llen = __last._M_cur - __last._M_first;
1082 _Tp* __lend = __last._M_cur;
1084 difference_type __rlen = __result._M_cur - __result._M_first;
1085 _Tp* __rend = __result._M_cur;
1089 __llen = _Self::_S_buffer_size();
1090 __lend = *(__last._M_node - 1) + __llen;
1094 __rlen = _Self::_S_buffer_size();
1095 __rend = *(__result._M_node - 1) + __rlen;
1098 const difference_type __clen =
std::min(__len,
1100 std::move_backward(__lend - __clen, __lend, __rend);
1109 _GLIBCXX_END_NAMESPACE_CONTAINER
void _M_fill_initialize(const value_type &__value)
Fills the deque with copies of value.
void _M_pop_back_aux()
Helper functions for push_* and pop_*.
A standard container using fixed-size memory allocation and constant-time manipulation of elements at...
void _M_push_back_aux(_Args &&...__args)
Helper functions for push_* and pop_*.
deque & operator=(const deque &__x)
Deque assignment operator.
void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)
Memory-handling helpers for the major map.
void _M_new_elements_at_front(size_type __new_elements)
Memory-handling helpers for the previous internal insert functions.
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initializer_list.
iterator emplace(const_iterator __position, _Args &&...__args)
Inserts an object in deque before specified iterator.
iterator begin() noexcept
iterator_traits< _Iter >::iterator_category __iterator_category(const _Iter &)
insert_iterator< _Container > inserter(_Container &__x, _Iterator __i)
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list. ...
allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
ISO C++ entities toplevel namespace is std.
void _M_push_front_aux(_Args &&...__args)
Helper functions for push_* and pop_*.
_GLIBCXX14_CONSTEXPR const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
_GLIBCXX17_CONSTEXPR iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
_GLIBCXX17_CONSTEXPR void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
Forward iterators support a superset of input iterator operations.
_GLIBCXX14_CONSTEXPR const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
void _M_new_elements_at_back(size_type __new_elements)
Memory-handling helpers for the previous internal insert functions.
Random-access iterators support a superset of bidirectional iterator operations.
void _M_pop_front_aux()
Helper functions for push_* and pop_*.
size_type size() const noexcept
void _Destroy(_Tp *__pointer)
void _M_range_initialize(_InputIterator __first, _InputIterator __last, std::input_iterator_tag)
Fills the deque with whatever is in [first,last).