.TH "std::deque< _Tp, _Alloc >" 3cxx "Sun Feb 7 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::deque< _Tp, _Alloc > \- A standard container using fixed-size memory allocation and constant-time manipulation of elements at either end\&. .SH SYNOPSIS .br .PP .PP Inherits \fBstd::_Deque_base< _Tp, std::allocator< _Tp > >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .ti -1c .RI "typedef \fB_Base::const_iterator\fP \fBconst_iterator\fP" .br .ti -1c .RI "typedef _Alloc_traits::const_pointer \fBconst_pointer\fP" .br .ti -1c .RI "typedef _Alloc_traits::const_reference \fBconst_reference\fP" .br .ti -1c .RI "typedef \fBstd::reverse_iterator\fP< \fBconst_iterator\fP > \fBconst_reverse_iterator\fP" .br .ti -1c .RI "typedef ptrdiff_t \fBdifference_type\fP" .br .ti -1c .RI "typedef \fB_Base::iterator\fP \fBiterator\fP" .br .ti -1c .RI "typedef _Alloc_traits::pointer \fBpointer\fP" .br .ti -1c .RI "typedef _Alloc_traits::reference \fBreference\fP" .br .ti -1c .RI "typedef \fBstd::reverse_iterator\fP< \fBiterator\fP > \fBreverse_iterator\fP" .br .ti -1c .RI "typedef size_t \fBsize_type\fP" .br .ti -1c .RI "typedef _Tp \fBvalue_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBdeque\fP ()" .br .RI "Creates a deque with no elements\&. " .ti -1c .RI "template> \fBdeque\fP (_InputIterator __first, _InputIterator __last, const allocator_type &__a=allocator_type())" .br .RI "Builds a deque from a range\&. " .ti -1c .RI "\fBdeque\fP (const allocator_type &__a)" .br .RI "Creates a deque with no elements\&. " .ti -1c .RI "\fBdeque\fP (const \fBdeque\fP &__x)" .br .RI "Deque copy constructor\&. " .ti -1c .RI "\fBdeque\fP (const \fBdeque\fP &__x, const allocator_type &__a)" .br .RI "Copy constructor with alternative allocator\&. " .ti -1c .RI "\fBdeque\fP (\fBdeque\fP &&__x)" .br .RI "Deque move constructor\&. " .ti -1c .RI "\fBdeque\fP (\fBdeque\fP &&__x, const allocator_type &__a)" .br .RI "Move constructor with alternative allocator\&. " .ti -1c .RI "\fBdeque\fP (\fBinitializer_list\fP< value_type > __l, const allocator_type &__a=allocator_type())" .br .RI "Builds a deque from an initializer list\&. " .ti -1c .RI "\fBdeque\fP (size_type __n, const allocator_type &__a=allocator_type())" .br .RI "Creates a deque with default constructed elements\&. " .ti -1c .RI "\fBdeque\fP (size_type __n, const value_type &__value, const allocator_type &__a=allocator_type())" .br .RI "Creates a deque with copies of an exemplar element\&. " .ti -1c .RI "\fB~deque\fP ()" .br .ti -1c .RI "template> void \fBassign\fP (_InputIterator __first, _InputIterator __last)" .br .RI "Assigns a range to a deque\&. " .ti -1c .RI "void \fBassign\fP (\fBinitializer_list\fP< value_type > __l)" .br .RI "Assigns an initializer list to a deque\&. " .ti -1c .RI "void \fBassign\fP (size_type __n, const value_type &__val)" .br .RI "Assigns a given value to a deque\&. " .ti -1c .RI "reference \fBat\fP (size_type __n)" .br .RI "Provides access to the data contained in the deque\&. " .ti -1c .RI "const_reference \fBat\fP (size_type __n) const" .br .RI "Provides access to the data contained in the deque\&. " .ti -1c .RI "const_reference \fBback\fP () const noexcept" .br .ti -1c .RI "reference \fBback\fP () noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBbegin\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBbegin\fP () noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBcbegin\fP () const noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBcend\fP () const noexcept" .br .ti -1c .RI "void \fBclear\fP () noexcept" .br .ti -1c .RI "\fBconst_reverse_iterator\fP \fBcrbegin\fP () const noexcept" .br .ti -1c .RI "\fBconst_reverse_iterator\fP \fBcrend\fP () const noexcept" .br .ti -1c .RI "template \fBiterator\fP \fBemplace\fP (\fBconst_iterator\fP __position, _Args &&\&.\&.\&. __args)" .br .RI "Inserts an object in deque before specified iterator\&. " .ti -1c .RI "template void \fBemplace_back\fP (_Args &&\&.\&.\&. __args)" .br .ti -1c .RI "template void \fBemplace_front\fP (_Args &&\&.\&.\&. __args)" .br .ti -1c .RI "_GLIBCXX_NODISCARD bool \fBempty\fP () const noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBend\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBend\fP () noexcept" .br .ti -1c .RI "\fBiterator\fP \fBerase\fP (\fBconst_iterator\fP __first, \fBconst_iterator\fP __last)" .br .RI "Remove a range of elements\&. " .ti -1c .RI "\fBiterator\fP \fBerase\fP (\fBconst_iterator\fP __position)" .br .RI "Remove element at given position\&. " .ti -1c .RI "const_reference \fBfront\fP () const noexcept" .br .ti -1c .RI "reference \fBfront\fP () noexcept" .br .ti -1c .RI "allocator_type \fBget_allocator\fP () const noexcept" .br .RI "Get a copy of the memory allocation object\&. " .ti -1c .RI "\fBiterator\fP \fBinsert\fP (\fBconst_iterator\fP __p, \fBinitializer_list\fP< value_type > __l)" .br .RI "Inserts an initializer list into the deque\&. " .ti -1c .RI "template> \fBiterator\fP \fBinsert\fP (\fBconst_iterator\fP __position, _InputIterator __first, _InputIterator __last)" .br .RI "Inserts a range into the deque\&. " .ti -1c .RI "\fBiterator\fP \fBinsert\fP (\fBconst_iterator\fP __position, const value_type &__x)" .br .RI "Inserts given value into deque before specified iterator\&. " .ti -1c .RI "\fBiterator\fP \fBinsert\fP (\fBconst_iterator\fP __position, size_type __n, const value_type &__x)" .br .RI "Inserts a number of copies of given data into the deque\&. " .ti -1c .RI "\fBiterator\fP \fBinsert\fP (\fBconst_iterator\fP __position, value_type &&__x)" .br .RI "Inserts given rvalue into deque before specified iterator\&. " .ti -1c .RI "size_type \fBmax_size\fP () const noexcept" .br .ti -1c .RI "\fBdeque\fP & \fBoperator=\fP (const \fBdeque\fP &__x)" .br .RI "Deque assignment operator\&. " .ti -1c .RI "\fBdeque\fP & \fBoperator=\fP (\fBdeque\fP &&__x) noexcept(_Alloc_traits::_S_always_equal())" .br .RI "Deque move assignment operator\&. " .ti -1c .RI "\fBdeque\fP & \fBoperator=\fP (\fBinitializer_list\fP< value_type > __l)" .br .RI "Assigns an initializer list to a deque\&. " .ti -1c .RI "const_reference \fBoperator[]\fP (size_type __n) const noexcept" .br .RI "Subscript access to the data contained in the deque\&. " .ti -1c .RI "reference \fBoperator[]\fP (size_type __n) noexcept" .br .RI "Subscript access to the data contained in the deque\&. " .ti -1c .RI "void \fBpop_back\fP () noexcept" .br .RI "Removes last element\&. " .ti -1c .RI "void \fBpop_front\fP () noexcept" .br .RI "Removes first element\&. " .ti -1c .RI "void \fBpush_back\fP (const value_type &__x)" .br .RI "Add data to the end of the deque\&. " .ti -1c .RI "void \fBpush_back\fP (value_type &&__x)" .br .ti -1c .RI "void \fBpush_front\fP (const value_type &__x)" .br .RI "Add data to the front of the deque\&. " .ti -1c .RI "void \fBpush_front\fP (value_type &&__x)" .br .ti -1c .RI "\fBconst_reverse_iterator\fP \fBrbegin\fP () const noexcept" .br .ti -1c .RI "\fBreverse_iterator\fP \fBrbegin\fP () noexcept" .br .ti -1c .RI "\fBconst_reverse_iterator\fP \fBrend\fP () const noexcept" .br .ti -1c .RI "\fBreverse_iterator\fP \fBrend\fP () noexcept" .br .ti -1c .RI "void \fBresize\fP (size_type __new_size)" .br .RI "Resizes the deque to the specified number of elements\&. " .ti -1c .RI "void \fBresize\fP (size_type __new_size, const value_type &__x)" .br .RI "Resizes the deque to the specified number of elements\&. " .ti -1c .RI "void \fBshrink_to_fit\fP () noexcept" .br .ti -1c .RI "size_type \fBsize\fP () const noexcept" .br .ti -1c .RI "void \fBswap\fP (\fBdeque\fP &__x) noexcept" .br .RI "Swaps data with another deque\&. " .in -1c .SS "Protected Types" .in +1c .ti -1c .RI "enum " .br .ti -1c .RI "typedef \fB__gnu_cxx::__alloc_traits\fP< _Map_alloc_type > \fB_Map_alloc_traits\fP" .br .ti -1c .RI "typedef _Alloc_traits::template rebind< _Ptr >::other \fB_Map_alloc_type\fP" .br .ti -1c .RI "typedef _Alloc_traits::pointer \fB_Ptr\fP" .br .ti -1c .RI "typedef _Alloc_traits::const_pointer \fB_Ptr_const\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "_Map_pointer \fB_M_allocate_map\fP (size_t __n)" .br .ti -1c .RI "_Map_pointer \fB_M_allocate_map\fP (size_t __n)" .br .ti -1c .RI "_Ptr \fB_M_allocate_node\fP ()" .br .ti -1c .RI "template void \fB_M_assign_aux\fP (_ForwardIterator __first, _ForwardIterator __last, \fBstd::forward_iterator_tag\fP)" .br .ti -1c .RI "template void \fB_M_assign_aux\fP (_InputIterator __first, _InputIterator __last, \fBstd::input_iterator_tag\fP)" .br .ti -1c .RI "template void \fB_M_assign_dispatch\fP (_InputIterator __first, _InputIterator __last, __false_type)" .br .ti -1c .RI "template void \fB_M_assign_dispatch\fP (_Integer __n, _Integer __val, __true_type)" .br .ti -1c .RI "void \fB_M_create_nodes\fP (_Map_pointer __nstart, _Map_pointer __nfinish)" .br .ti -1c .RI "void \fB_M_create_nodes\fP (_Map_pointer __nstart, _Map_pointer __nfinish)" .br .ti -1c .RI "void \fB_M_deallocate_map\fP (_Map_pointer __p, size_t __n) noexcept" .br .ti -1c .RI "void \fB_M_deallocate_map\fP (_Map_pointer __p, size_t __n) noexcept" .br .ti -1c .RI "void \fB_M_deallocate_node\fP (_Ptr __p) noexcept" .br .ti -1c .RI "void \fB_M_deallocate_node\fP (_Ptr __p) noexcept" .br .ti -1c .RI "void \fB_M_default_append\fP (size_type __n)" .br .ti -1c .RI "void \fB_M_default_initialize\fP ()" .br .ti -1c .RI "template void \fB_M_destroy_data\fP (\fBiterator\fP __first, \fBiterator\fP __last, const _Alloc1 &)" .br .ti -1c .RI "void \fB_M_destroy_data\fP (\fBiterator\fP __first, \fBiterator\fP __last, const \fBstd::allocator\fP< _Tp > &)" .br .ti -1c .RI "void \fB_M_destroy_data_aux\fP (\fBiterator\fP __first, \fBiterator\fP __last)" .br .ti -1c .RI "void \fB_M_destroy_nodes\fP (_Map_pointer __nstart, _Map_pointer __nfinish) noexcept" .br .ti -1c .RI "void \fB_M_destroy_nodes\fP (_Map_pointer __nstart, _Map_pointer __nfinish) noexcept" .br .ti -1c .RI "\fBiterator\fP \fB_M_erase\fP (\fBiterator\fP __first, \fBiterator\fP __last)" .br .ti -1c .RI "\fBiterator\fP \fB_M_erase\fP (\fBiterator\fP __pos)" .br .ti -1c .RI "void \fB_M_erase_at_begin\fP (\fBiterator\fP __pos)" .br .ti -1c .RI "void \fB_M_erase_at_end\fP (\fBiterator\fP __pos)" .br .ti -1c .RI "void \fB_M_fill_assign\fP (size_type __n, const value_type &__val)" .br .ti -1c .RI "void \fB_M_fill_initialize\fP (const value_type &__value)" .br .RI "Fills the deque with copies of value\&. " .ti -1c .RI "void \fB_M_fill_insert\fP (\fBiterator\fP __pos, size_type __n, const value_type &__x)" .br .ti -1c .RI "_Map_alloc_type \fB_M_get_map_allocator\fP () const noexcept" .br .ti -1c .RI "const _Tp_alloc_type & \fB_M_get_Tp_allocator\fP () const noexcept" .br .ti -1c .RI "const _Tp_alloc_type & \fB_M_get_Tp_allocator\fP () const noexcept" .br .ti -1c .RI "_Tp_alloc_type & \fB_M_get_Tp_allocator\fP () noexcept" .br .ti -1c .RI "template void \fB_M_initialize_dispatch\fP (_InputIterator __first, _InputIterator __last, __false_type)" .br .ti -1c .RI "template void \fB_M_initialize_dispatch\fP (_Integer __n, _Integer __x, __true_type)" .br .ti -1c .RI "void \fB_M_initialize_map\fP (size_t)" .br .RI "Layout storage\&. " .ti -1c .RI "void \fB_M_initialize_map\fP (size_t)" .br .RI "Layout storage\&. " .ti -1c .RI "template \fBiterator\fP \fB_M_insert_aux\fP (\fBiterator\fP __pos, _Args &&\&.\&.\&. __args)" .br .ti -1c .RI "template void \fB_M_insert_aux\fP (\fBiterator\fP __pos, _ForwardIterator __first, _ForwardIterator __last, size_type __n)" .br .ti -1c .RI "void \fB_M_insert_aux\fP (\fBiterator\fP __pos, size_type __n, const value_type &__x)" .br .ti -1c .RI "template void \fB_M_insert_dispatch\fP (\fBiterator\fP __pos, _InputIterator __first, _InputIterator __last, __false_type)" .br .ti -1c .RI "template void \fB_M_insert_dispatch\fP (\fBiterator\fP __pos, _Integer __n, _Integer __x, __true_type)" .br .ti -1c .RI "void \fB_M_move_assign1\fP (\fBdeque\fP &&__x, \fBfalse_type\fP)" .br .ti -1c .RI "void \fB_M_move_assign1\fP (\fBdeque\fP &&__x, \fBtrue_type\fP) noexcept" .br .ti -1c .RI "void \fB_M_move_assign2\fP (\fBdeque\fP &&__x, \fBfalse_type\fP)" .br .ti -1c .RI "void \fB_M_move_assign2\fP (\fBdeque\fP &&__x, \fBtrue_type\fP)" .br .ti -1c .RI "void \fB_M_new_elements_at_back\fP (size_type __new_elements)" .br .ti -1c .RI "void \fB_M_new_elements_at_front\fP (size_type __new_elements)" .br .ti -1c .RI "void \fB_M_pop_back_aux\fP ()" .br .ti -1c .RI "void \fB_M_pop_front_aux\fP ()" .br .ti -1c .RI "template void \fB_M_push_back_aux\fP (_Args &&\&.\&.\&. __args)" .br .RI "Helper functions for push_* and pop_*\&. " .ti -1c .RI "template void \fB_M_push_front_aux\fP (_Args &&\&.\&.\&. __args)" .br .ti -1c .RI "void \fB_M_range_check\fP (size_type __n) const" .br .RI "Safety check used only from at()\&. " .ti -1c .RI "template void \fB_M_range_initialize\fP (_ForwardIterator __first, _ForwardIterator __last, \fBstd::forward_iterator_tag\fP)" .br .ti -1c .RI "template void \fB_M_range_initialize\fP (_InputIterator __first, _InputIterator __last, \fBstd::input_iterator_tag\fP)" .br .RI "Fills the deque with whatever is in [first,last)\&. " .ti -1c .RI "template void \fB_M_range_insert_aux\fP (\fBiterator\fP __pos, _ForwardIterator __first, _ForwardIterator __last, \fBstd::forward_iterator_tag\fP)" .br .ti -1c .RI "template void \fB_M_range_insert_aux\fP (\fBiterator\fP __pos, _InputIterator __first, _InputIterator __last, \fBstd::input_iterator_tag\fP)" .br .ti -1c .RI "void \fB_M_reallocate_map\fP (size_type __nodes_to_add, bool __add_at_front)" .br .ti -1c .RI "template void \fB_M_replace_map\fP (_Args &&\&.\&.\&. __args)" .br .ti -1c .RI "\fBiterator\fP \fB_M_reserve_elements_at_back\fP (size_type __n)" .br .ti -1c .RI "\fBiterator\fP \fB_M_reserve_elements_at_front\fP (size_type __n)" .br .RI "Memory-handling helpers for the previous internal insert functions\&. " .ti -1c .RI "void \fB_M_reserve_map_at_back\fP (size_type __nodes_to_add=1)" .br .RI "Memory-handling helpers for the major map\&. " .ti -1c .RI "void \fB_M_reserve_map_at_front\fP (size_type __nodes_to_add=1)" .br .ti -1c .RI "bool \fB_M_shrink_to_fit\fP ()" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static size_t \fB_S_buffer_size\fP () noexcept" .br .ti -1c .RI "static size_t \fB_S_check_init_len\fP (size_t __n, const allocator_type &__a)" .br .ti -1c .RI "static size_type \fB_S_max_size\fP (const _Tp_alloc_type &__a) noexcept" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "_Deque_impl \fB_M_impl\fP" .br .in -1c .SH "Detailed Description" .PP .SS "template> .br class std::deque< _Tp, _Alloc >" A standard container using fixed-size memory allocation and constant-time manipulation of elements at either end\&. .PP \fBTemplate Parameters\fP .RS 4 \fI_Tp\fP Type of element\&. .br \fI_Alloc\fP Allocator type, defaults to allocator<_Tp>\&. .RE .PP Meets the requirements of a \fCcontainer\fP, a \fCreversible container\fP, and a \fCsequence\fP, including the \fCoptional sequence requirements\fP\&. .PP In previous HP/SGI versions of deque, there was an extra template parameter so users could control the node size\&. This extension turned out to violate the C++ standard (it can be detected using template template parameters), and it was removed\&. .PP Here's how a deque manages memory\&. Each deque has 4 members: .PP .IP "\(bu" 2 Tp** _M_map .IP "\(bu" 2 size_t _M_map_size .IP "\(bu" 2 iterator _M_start, _M_finish .PP .PP map_size is at least 8\&. map is an array of map_size pointers-to-\fInodes\fP\&. (The name map has nothing to do with the std::map class, and \fBnodes\fP should not be confused with std::list's usage of \fInode\fP\&.) .PP A \fInode\fP has no specific type name as such, but it is referred to as \fInode\fP in this file\&. It is a simple array-of-Tp\&. If Tp is very large, there will be one Tp element per node (i\&.e\&., an \fIarray\fP of one)\&. For non-huge Tp's, node size is inversely related to Tp size: the larger the Tp, the fewer Tp's will fit in a node\&. The goal here is to keep the total size of a node relatively small and constant over different Tp's, to improve allocator efficiency\&. .PP Not every pointer in the map array will point to a node\&. If the initial number of elements in the deque is small, the /middle/ map pointers will be valid, and the ones at the edges will be unused\&. This same situation will arise as the map grows: available map pointers, if any, will be on the ends\&. As new nodes are created, only a subset of the map's pointers need to be copied \fIoutward\fP\&. .PP Class invariants: .IP "\(bu" 2 For any nonsingular iterator i: .IP " \(bu" 4 i\&.node points to a member of the map array\&. (Yes, you read that correctly: i\&.node does not actually point to a node\&.) The member of the map array is what actually points to the node\&. .IP " \(bu" 4 i\&.first == *(i\&.node) (This points to the node (first Tp element)\&.) .IP " \(bu" 4 i\&.last == i\&.first + node_size .IP " \(bu" 4 i\&.cur is a pointer in the range [i\&.first, i\&.last)\&. NOTE: the implication of this is that i\&.cur is always a dereferenceable pointer, even if i is a past-the-end iterator\&. .PP .IP "\(bu" 2 Start and Finish are always nonsingular iterators\&. NOTE: this means that an empty deque must have one node, a deque with > \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP ()\fC [inline]\fP" .PP Creates a deque with no elements\&. .PP Definition at line 915 of file stl_deque\&.h\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (const allocator_type & __a)\fC [inline]\fP, \fC [explicit]\fP" .PP Creates a deque with no elements\&. .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator object\&. .RE .PP .PP Definition at line 922 of file stl_deque\&.h\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (size_type __n, const allocator_type & __a = \fCallocator_type()\fP)\fC [inline]\fP, \fC [explicit]\fP" .PP Creates a deque with default constructed elements\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The number of elements to initially create\&. .br \fI__a\fP An allocator\&. .RE .PP This constructor fills the deque with \fIn\fP default constructed elements\&. .PP Definition at line 935 of file stl_deque\&.h\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (size_type __n, const value_type & __value, const allocator_type & __a = \fCallocator_type()\fP)\fC [inline]\fP" .PP Creates a deque with copies of an exemplar element\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The number of elements to initially create\&. .br \fI__value\fP An element to copy\&. .br \fI__a\fP An allocator\&. .RE .PP This constructor fills the deque with \fI__n\fP copies of \fI__value\fP\&. .PP Definition at line 947 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_fill_initialize()\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (const \fBdeque\fP< _Tp, _Alloc > & __x)\fC [inline]\fP" .PP Deque copy constructor\&. .PP \fBParameters\fP .RS 4 \fI__x\fP A deque of identical element and allocator types\&. .RE .PP The newly-created deque uses a copy of the allocator object used by \fI__x\fP (unless the allocator traits dictate a different object)\&. .PP Definition at line 974 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::begin(), and std::deque< _Tp, _Alloc >::end()\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (\fBdeque\fP< _Tp, _Alloc > && __x)\fC [inline]\fP" .PP Deque move constructor\&. .PP \fBParameters\fP .RS 4 \fI__x\fP A deque of identical element and allocator types\&. .RE .PP The newly-created deque contains the exact contents of \fI__x\fP\&. The contents of \fI__x\fP are a valid, but unspecified deque\&. .PP Definition at line 989 of file stl_deque\&.h\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (const \fBdeque\fP< _Tp, _Alloc > & __x, const allocator_type & __a)\fC [inline]\fP" .PP Copy constructor with alternative allocator\&. .PP Definition at line 993 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::begin(), and std::deque< _Tp, _Alloc >::end()\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (\fBdeque\fP< _Tp, _Alloc > && __x, const allocator_type & __a)\fC [inline]\fP" .PP Move constructor with alternative allocator\&. .PP Definition at line 1000 of file stl_deque\&.h\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (\fBinitializer_list\fP< value_type > __l, const allocator_type & __a = \fCallocator_type()\fP)\fC [inline]\fP" .PP Builds a deque from an initializer list\&. .PP \fBParameters\fP .RS 4 \fI__l\fP An initializer_list\&. .br \fI__a\fP An allocator object\&. .RE .PP Create a deque consisting of copies of the elements in the initializer_list \fI__l\fP\&. .PP This will call the element type's copy constructor N times (where N is __l\&.size()) and do no memory reallocation\&. .PP Definition at line 1023 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_range_initialize()\&. .SS "template> template> \fBstd::deque\fP< _Tp, _Alloc >::\fBdeque\fP (_InputIterator __first, _InputIterator __last, const allocator_type & __a = \fCallocator_type()\fP)\fC [inline]\fP" .PP Builds a deque from a range\&. .PP \fBParameters\fP .RS 4 \fI__first\fP An input iterator\&. .br \fI__last\fP An input iterator\&. .br \fI__a\fP An allocator object\&. .RE .PP Create a deque consisting of copies of the elements from [__first, __last)\&. .PP If the iterators are forward, bidirectional, or random-access, then this will call the elements' copy constructor N times (where N is distance(__first,__last)) and do no memory reallocation\&. But if only input iterators are used, then this will do at most 2N calls to the copy constructor, and logN memory reallocations\&. .PP Definition at line 1050 of file stl_deque\&.h\&. .SS "template> \fBstd::deque\fP< _Tp, _Alloc >::~\fBdeque\fP ()\fC [inline]\fP" The dtor only erases the elements, and note that if the elements themselves are pointers, the pointed-to memory is not touched in any way\&. Managing the pointer is the user's responsibility\&. .PP Definition at line 1071 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::begin(), and std::deque< _Tp, _Alloc >::end()\&. .SH "Member Function Documentation" .PP .SS "template void deque::_M_fill_initialize (const value_type & __value)\fC [protected]\fP" .PP Fills the deque with copies of value\&. .PP \fBParameters\fP .RS 4 \fI__value\fP Initial value\&. .RE .PP \fBReturns\fP .RS 4 Nothing\&. .RE .PP \fBPrecondition\fP .RS 4 _M_start and _M_finish have already been initialized, but none of the deque's elements have yet been constructed\&. .RE .PP This function is called only when the user provides an explicit size (with or without an explicit exemplar value)\&. .PP Definition at line 391 of file deque\&.tcc\&. .PP Referenced by std::deque< _Tp, _Alloc >::deque()\&. .SS "void \fBstd::_Deque_base\fP< _Tp, \fBstd::allocator\fP< _Tp > >::_M_initialize_map (size_t __num_elements)\fC [protected]\fP, \fC [inherited]\fP" .PP Layout storage\&. .PP \fBParameters\fP .RS 4 \fI__num_elements\fP The count of T's for which to allocate space at first\&. .RE .PP \fBReturns\fP .RS 4 Nothing\&. .RE .PP The initial underlying memory layout is a bit complicated\&.\&.\&. .PP Definition at line 645 of file stl_deque\&.h\&. .SS "template> void \fBstd::_Deque_base\fP< _Tp, _Alloc >::_M_initialize_map\fC [protected]\fP" .PP Layout storage\&. .PP \fBParameters\fP .RS 4 \fI__num_elements\fP The count of T's for which to allocate space at first\&. .RE .PP \fBReturns\fP .RS 4 Nothing\&. .RE .PP The initial underlying memory layout is a bit complicated\&.\&.\&. .PP Definition at line 645 of file stl_deque\&.h\&. .SS "template template void deque::_M_push_back_aux (_Args &&\&.\&.\&. __args)\fC [protected]\fP" .PP Helper functions for push_* and pop_*\&. .PP Definition at line 479 of file deque\&.tcc\&. .PP Referenced by std::deque< _Tp, _Alloc >::push_back()\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::_M_range_check (size_type __n) const\fC [inline]\fP, \fC [protected]\fP" .PP Safety check used only from at()\&. .PP Definition at line 1427 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::size()\&. .PP Referenced by std::deque< _Tp, _Alloc >::at()\&. .SS "template template void deque::_M_range_initialize (_InputIterator __first, _InputIterator __last, \fBstd::input_iterator_tag\fP)\fC [protected]\fP" .PP Fills the deque with whatever is in [first,last)\&. .PP \fBParameters\fP .RS 4 \fI__first\fP An input iterator\&. .br \fI__last\fP An input iterator\&. .RE .PP \fBReturns\fP .RS 4 Nothing\&. .RE .PP If the iterators are actually forward iterators (or better), then the memory layout can be done all at once\&. Else we move forward using push_back on each value from the iterator\&. .PP Definition at line 417 of file deque\&.tcc\&. .PP Referenced by std::deque< _Tp, _Alloc >::deque()\&. .SS "template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::_M_reserve_elements_at_front (size_type __n)\fC [inline]\fP, \fC [protected]\fP" .PP Memory-handling helpers for the previous internal insert functions\&. .PP Definition at line 2158 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::_M_reserve_map_at_back (size_type __nodes_to_add = \fC1\fP)\fC [inline]\fP, \fC [protected]\fP" .PP Memory-handling helpers for the major map\&. Makes sure the _M_map has space for new nodes\&. Does not actually add the nodes\&. Can invalidate _M_map pointers\&. (And consequently, deque iterators\&.) .PP Definition at line 2194 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> template> void \fBstd::deque\fP< _Tp, _Alloc >::assign (_InputIterator __first, _InputIterator __last)\fC [inline]\fP" .PP Assigns a range to a deque\&. .PP \fBParameters\fP .RS 4 \fI__first\fP An input iterator\&. .br \fI__last\fP An input iterator\&. .RE .PP This function fills a deque with copies of the elements in the range [__first,__last)\&. .PP Note that the assignment completely changes the deque and that the resulting deque's size is the same as the number of elements assigned\&. .PP Definition at line 1153 of file stl_deque\&.h\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::assign (\fBinitializer_list\fP< value_type > __l)\fC [inline]\fP" .PP Assigns an initializer list to a deque\&. .PP \fBParameters\fP .RS 4 \fI__l\fP An initializer_list\&. .RE .PP This function fills a deque with copies of the elements in the initializer_list \fI__l\fP\&. .PP Note that the assignment completely changes the deque and that the resulting deque's size is the same as the number of elements assigned\&. .PP Definition at line 1178 of file stl_deque\&.h\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::assign (size_type __n, const value_type & __val)\fC [inline]\fP" .PP Assigns a given value to a deque\&. .PP \fBParameters\fP .RS 4 \fI__n\fP Number of elements to be assigned\&. .br \fI__val\fP Value to be assigned\&. .RE .PP This function fills a deque with \fIn\fP copies of the given value\&. Note that the assignment completely changes the deque and that the resulting deque's size is the same as the number of elements assigned\&. .PP Definition at line 1134 of file stl_deque\&.h\&. .SS "template> reference \fBstd::deque\fP< _Tp, _Alloc >::at (size_type __n)\fC [inline]\fP" .PP Provides access to the data contained in the deque\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The index of the element for which data should be accessed\&. .RE .PP \fBReturns\fP .RS 4 Read/write reference to data\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::out_of_range\fP If \fI__n\fP is an invalid index\&. .RE .PP This function provides for safer data access\&. The parameter is first checked that it is in the range of the deque\&. The function throws out_of_range if the check fails\&. .PP Definition at line 1449 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_range_check()\&. .SS "template> const_reference \fBstd::deque\fP< _Tp, _Alloc >::at (size_type __n) const\fC [inline]\fP" .PP Provides access to the data contained in the deque\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The index of the element for which data should be accessed\&. .RE .PP \fBReturns\fP .RS 4 Read-only (constant) reference to data\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::out_of_range\fP If \fI__n\fP is an invalid index\&. .RE .PP This function provides for safer data access\&. The parameter is first checked that it is in the range of the deque\&. The function throws out_of_range if the check fails\&. .PP Definition at line 1467 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_range_check()\&. .SS "template> const_reference \fBstd::deque\fP< _Tp, _Alloc >::back () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reference to the data at the last element of the deque\&. .PP Definition at line 1513 of file stl_deque\&.h\&. .SS "template> reference \fBstd::deque\fP< _Tp, _Alloc >::back ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write reference to the data at the last element of the deque\&. .PP Definition at line 1500 of file stl_deque\&.h\&. .SS "template> \fBconst_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::begin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points to the first element in the deque\&. Iteration is done in ordinary element order\&. .PP Definition at line 1201 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::begin ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write iterator that points to the first element in the deque\&. Iteration is done in ordinary element order\&. .PP Definition at line 1193 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .PP Referenced by std::deque< _Tp, _Alloc >::deque(), std::deque< _Tp, _Alloc >::~deque(), std::deque< _Tp, _Alloc >::clear(), std::deque< _Tp, _Alloc >::insert(), std::operator<(), std::deque< _Tp, _Alloc >::operator=(), and std::operator==()\&. .SS "template> \fBconst_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::cbegin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points to the first element in the deque\&. Iteration is done in ordinary element order\&. .PP Definition at line 1264 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .PP Referenced by std::deque< _Tp, _Alloc >::insert()\&. .SS "template> \fBconst_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::cend () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points one past the last element in the deque\&. Iteration is done in ordinary element order\&. .PP Definition at line 1273 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::clear ()\fC [inline]\fP, \fC [noexcept]\fP" Erases all the elements\&. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way\&. Managing the pointer is the user's responsibility\&. .PP Definition at line 1867 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::begin()\&. .SS "template> \fBconst_reverse_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::crbegin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reverse iterator that points to the last element in the deque\&. Iteration is done in reverse element order\&. .PP Definition at line 1282 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> \fBconst_reverse_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::crend () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reverse iterator that points to one before the first element in the deque\&. Iteration is done in reverse element order\&. .PP Definition at line 1291 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template template \fBdeque\fP< _Tp, _Alloc >::\fBiterator\fP deque::emplace (\fBconst_iterator\fP __position, _Args &&\&.\&.\&. __args)" .PP Inserts an object in deque before specified iterator\&. .PP \fBParameters\fP .RS 4 \fI__position\fP A const_iterator into the deque\&. .br \fI__args\fP Arguments\&. .RE .PP \fBReturns\fP .RS 4 An iterator that points to the inserted data\&. .RE .PP This function will insert an object of type T constructed with T(std::forward(args)\&.\&.\&.) before the specified location\&. .PP Definition at line 185 of file deque\&.tcc\&. .PP Referenced by std::deque< _Tp, _Alloc >::insert()\&. .SS "template> _GLIBCXX_NODISCARD bool \fBstd::deque\fP< _Tp, _Alloc >::empty () const\fC [inline]\fP, \fC [noexcept]\fP" Returns true if the deque is empty\&. (Thus begin() would equal end()\&.) .PP Definition at line 1384 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> \fBconst_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::end () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points one past the last element in the deque\&. Iteration is done in ordinary element order\&. .PP Definition at line 1219 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::end ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write iterator that points one past the last element in the deque\&. Iteration is done in ordinary element order\&. .PP Definition at line 1210 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .PP Referenced by std::deque< _Tp, _Alloc >::deque(), std::deque< _Tp, _Alloc >::~deque(), std::operator<(), std::deque< _Tp, _Alloc >::operator=(), and std::operator==()\&. .SS "template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::erase (\fBconst_iterator\fP __first, \fBconst_iterator\fP __last)\fC [inline]\fP" .PP Remove a range of elements\&. .PP \fBParameters\fP .RS 4 \fI__first\fP Iterator pointing to the first element to be erased\&. .br \fI__last\fP Iterator pointing to one past the last element to be erased\&. .RE .PP \fBReturns\fP .RS 4 An iterator pointing to the element pointed to by \fIlast\fP prior to erasing (or end())\&. .RE .PP This function will erase the elements in the range [__first,__last) and shorten the deque accordingly\&. .PP The user is cautioned that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way\&. Managing the pointer is the user's responsibility\&. .PP Definition at line 1831 of file stl_deque\&.h\&. .SS "template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::erase (\fBconst_iterator\fP __position)\fC [inline]\fP" .PP Remove element at given position\&. .PP \fBParameters\fP .RS 4 \fI__position\fP Iterator pointing to element to be erased\&. .RE .PP \fBReturns\fP .RS 4 An iterator pointing to the next element (or end())\&. .RE .PP This function will erase the element at the given position and thus shorten the deque by one\&. .PP The user is cautioned that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way\&. Managing the pointer is the user's responsibility\&. .PP Definition at line 1807 of file stl_deque\&.h\&. .SS "template> const_reference \fBstd::deque\fP< _Tp, _Alloc >::front () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reference to the data at the first element of the deque\&. .PP Definition at line 1489 of file stl_deque\&.h\&. .SS "template> reference \fBstd::deque\fP< _Tp, _Alloc >::front ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write reference to the data at the first element of the deque\&. .PP Definition at line 1478 of file stl_deque\&.h\&. .SS "template> allocator_type \fBstd::deque\fP< _Tp, _Alloc >::get_allocator () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Get a copy of the memory allocation object\&. .PP Definition at line 1184 of file stl_deque\&.h\&. .PP Referenced by std::deque< _Tp, _Alloc >::operator=()\&. .SS "template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::insert (\fBconst_iterator\fP __p, \fBinitializer_list\fP< value_type > __l)\fC [inline]\fP" .PP Inserts an initializer list into the deque\&. .PP \fBParameters\fP .RS 4 \fI__p\fP An iterator into the deque\&. .br \fI__l\fP An initializer_list\&. .RE .PP This function will insert copies of the data in the initializer_list \fI__l\fP into the deque before the location specified by \fI__p\fP\&. This is known as \fIlist insert\fP\&. .PP Definition at line 1705 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::begin(), and std::deque< _Tp, _Alloc >::cbegin()\&. .SS "template> template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::insert (\fBconst_iterator\fP __position, _InputIterator __first, _InputIterator __last)\fC [inline]\fP" .PP Inserts a range into the deque\&. .PP \fBParameters\fP .RS 4 \fI__position\fP A const_iterator into the deque\&. .br \fI__first\fP An input iterator\&. .br \fI__last\fP An input iterator\&. .RE .PP \fBReturns\fP .RS 4 An iterator that points to the inserted data\&. .RE .PP This function will insert copies of the data in the range [__first,__last) into the deque before the location specified by \fI__position\fP\&. This is known as \fIrange insert\fP\&. .PP Definition at line 1762 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::begin(), and std::deque< _Tp, _Alloc >::cbegin()\&. .SS "template \fBdeque\fP< _Tp, _Alloc >::\fBiterator\fP deque::insert (\fBconst_iterator\fP __position, const value_type & __x)" .PP Inserts given value into deque before specified iterator\&. .PP \fBParameters\fP .RS 4 \fI__position\fP A const_iterator into the deque\&. .br \fI__x\fP Data to be inserted\&. .RE .PP \fBReturns\fP .RS 4 An iterator that points to the inserted data\&. .RE .PP This function will insert a copy of the given value before the specified location\&. .PP Definition at line 208 of file deque\&.tcc\&. .SS "template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::insert (\fBconst_iterator\fP __position, size_type __n, const value_type & __x)\fC [inline]\fP" .PP Inserts a number of copies of given data into the deque\&. .PP \fBParameters\fP .RS 4 \fI__position\fP A const_iterator into the deque\&. .br \fI__n\fP Number of elements to be inserted\&. .br \fI__x\fP Data to be inserted\&. .RE .PP \fBReturns\fP .RS 4 An iterator that points to the inserted data\&. .RE .PP This function will insert a specified number of copies of the given data before the location specified by \fI__position\fP\&. .PP Definition at line 1726 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::begin(), and std::deque< _Tp, _Alloc >::cbegin()\&. .SS "template> \fBiterator\fP \fBstd::deque\fP< _Tp, _Alloc >::insert (\fBconst_iterator\fP __position, value_type && __x)\fC [inline]\fP" .PP Inserts given rvalue into deque before specified iterator\&. .PP \fBParameters\fP .RS 4 \fI__position\fP A const_iterator into the deque\&. .br \fI__x\fP Data to be inserted\&. .RE .PP \fBReturns\fP .RS 4 An iterator that points to the inserted data\&. .RE .PP This function will insert a copy of the given rvalue before the specified location\&. .PP Definition at line 1692 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::emplace()\&. .SS "template> size_type \fBstd::deque\fP< _Tp, _Alloc >::max_size () const\fC [inline]\fP, \fC [noexcept]\fP" Returns the size() of the largest possible deque\&. .PP Definition at line 1303 of file stl_deque\&.h\&. .SS "template \fBdeque\fP< _Tp, _Alloc > & deque::operator= (const \fBdeque\fP< _Tp, _Alloc > & __x)" .PP Deque assignment operator\&. .PP \fBParameters\fP .RS 4 \fI__x\fP A deque of identical element and allocator types\&. .RE .PP All the elements of \fIx\fP are copied\&. .PP The newly-created deque uses a copy of the allocator object used by \fI__x\fP (unless the allocator traits dictate a different object)\&. .PP Definition at line 93 of file deque\&.tcc\&. .PP References std::deque< _Tp, _Alloc >::begin(), std::deque< _Tp, _Alloc >::end(), std::deque< _Tp, _Alloc >::get_allocator(), and std::deque< _Tp, _Alloc >::size()\&. .SS "template> \fBdeque\fP& \fBstd::deque\fP< _Tp, _Alloc >::operator= (\fBdeque\fP< _Tp, _Alloc > && __x)\fC [inline]\fP, \fC [noexcept]\fP" .PP Deque move assignment operator\&. .PP \fBParameters\fP .RS 4 \fI__x\fP A deque of identical element and allocator types\&. .RE .PP The contents of \fI__x\fP are moved into this deque (without copying, if the allocators permit it)\&. \fI__x\fP is a valid, but unspecified deque\&. .PP Definition at line 1096 of file stl_deque\&.h\&. .SS "template> \fBdeque\fP& \fBstd::deque\fP< _Tp, _Alloc >::operator= (\fBinitializer_list\fP< value_type > __l)\fC [inline]\fP" .PP Assigns an initializer list to a deque\&. .PP \fBParameters\fP .RS 4 \fI__l\fP An initializer_list\&. .RE .PP This function fills a deque with copies of the elements in the initializer_list \fI__l\fP\&. .PP Note that the assignment completely changes the deque and that the resulting deque's size is the same as the number of elements assigned\&. .PP Definition at line 1115 of file stl_deque\&.h\&. .SS "template> const_reference \fBstd::deque\fP< _Tp, _Alloc >::operator[] (size_type __n) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Subscript access to the data contained in the deque\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The index of the element for which data should be accessed\&. .RE .PP \fBReturns\fP .RS 4 Read-only (constant) reference to data\&. .RE .PP This operator allows for easy, array-style, data access\&. Note that data access with this operator is unchecked and out_of_range lookups are not defined\&. (For checked lookups see at()\&.) .PP Definition at line 1418 of file stl_deque\&.h\&. .SS "template> reference \fBstd::deque\fP< _Tp, _Alloc >::operator[] (size_type __n)\fC [inline]\fP, \fC [noexcept]\fP" .PP Subscript access to the data contained in the deque\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The index of the element for which data should be accessed\&. .RE .PP \fBReturns\fP .RS 4 Read/write reference to data\&. .RE .PP This operator allows for easy, array-style, data access\&. Note that data access with this operator is unchecked and out_of_range lookups are not defined\&. (For checked lookups see at()\&.) .PP Definition at line 1400 of file stl_deque\&.h\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::pop_back ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Removes last element\&. This is a typical stack operation\&. It shrinks the deque by one\&. .PP Note that no data is returned, and if the last element's data is needed, it should be retrieved before pop_back() is called\&. .PP Definition at line 1628 of file stl_deque\&.h\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::pop_front ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Removes first element\&. This is a typical stack operation\&. It shrinks the deque by one\&. .PP Note that no data is returned, and if the first element's data is needed, it should be retrieved before pop_front() is called\&. .PP Definition at line 1605 of file stl_deque\&.h\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::push_back (const value_type & __x)\fC [inline]\fP" .PP Add data to the end of the deque\&. .PP \fBParameters\fP .RS 4 \fI__x\fP Data to be added\&. .RE .PP This is a typical stack operation\&. The function creates an element at the end of the deque and assigns the given data to it\&. Due to the nature of a deque this operation can be done in constant time\&. .PP Definition at line 1569 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl, and std::deque< _Tp, _Alloc >::_M_push_back_aux()\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::push_front (const value_type & __x)\fC [inline]\fP" .PP Add data to the front of the deque\&. .PP \fBParameters\fP .RS 4 \fI__x\fP Data to be added\&. .RE .PP This is a typical stack operation\&. The function creates an element at the front of the deque and assigns the given data to it\&. Due to the nature of a deque this operation can be done in constant time\&. .PP Definition at line 1532 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> \fBconst_reverse_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::rbegin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reverse iterator that points to the last element in the deque\&. Iteration is done in reverse element order\&. .PP Definition at line 1237 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> \fBreverse_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::rbegin ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write reverse iterator that points to the last element in the deque\&. Iteration is done in reverse element order\&. .PP Definition at line 1228 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> \fBconst_reverse_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::rend () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reverse iterator that points to one before the first element in the deque\&. Iteration is done in reverse element order\&. .PP Definition at line 1255 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> \fBreverse_iterator\fP \fBstd::deque\fP< _Tp, _Alloc >::rend ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write reverse iterator that points to one before the first element in the deque\&. Iteration is done in reverse element order\&. .PP Definition at line 1246 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::resize (size_type __new_size)\fC [inline]\fP" .PP Resizes the deque to the specified number of elements\&. .PP \fBParameters\fP .RS 4 \fI__new_size\fP Number of elements the deque should contain\&. .RE .PP This function will resize the deque to the specified number of elements\&. If the number is smaller than the deque's current size the deque is truncated, otherwise default constructed elements are appended\&. .PP Definition at line 1317 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl, and std::deque< _Tp, _Alloc >::size()\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::resize (size_type __new_size, const value_type & __x)\fC [inline]\fP" .PP Resizes the deque to the specified number of elements\&. .PP \fBParameters\fP .RS 4 \fI__new_size\fP Number of elements the deque should contain\&. .br \fI__x\fP Data with which new elements should be populated\&. .RE .PP This function will resize the deque to the specified number of elements\&. If the number is smaller than the deque's current size the deque is truncated, otherwise the deque is extended and new elements are populated with given data\&. .PP Definition at line 1339 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl, and std::deque< _Tp, _Alloc >::size()\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::shrink_to_fit ()\fC [inline]\fP, \fC [noexcept]\fP" A non-binding request to reduce memory use\&. .PP Definition at line 1375 of file stl_deque\&.h\&. .SS "template> size_type \fBstd::deque\fP< _Tp, _Alloc >::size () const\fC [inline]\fP, \fC [noexcept]\fP" Returns the number of elements in the deque\&. .PP Definition at line 1298 of file stl_deque\&.h\&. .PP References std::deque< _Tp, _Alloc >::_M_impl\&. .PP Referenced by std::deque< _Tp, _Alloc >::_M_range_check(), std::deque< _Tp, _Alloc >::operator=(), std::operator==(), and std::deque< _Tp, _Alloc >::resize()\&. .SS "template> void \fBstd::deque\fP< _Tp, _Alloc >::swap (\fBdeque\fP< _Tp, _Alloc > & __x)\fC [inline]\fP, \fC [noexcept]\fP" .PP Swaps data with another deque\&. .PP \fBParameters\fP .RS 4 \fI__x\fP A deque of the same element and allocator types\&. .RE .PP This exchanges the elements between two deques in constant time\&. (Four pointers, so it should be quite fast\&.) Note that the global std::swap() function is specialized such that std::swap(d1,d2) will feed to this function\&. .PP Whether the allocators are swapped depends on the allocator traits\&. .PP Definition at line 1849 of file stl_deque\&.h\&. .SH "Member Data Documentation" .PP .SS "template> _Deque_impl \fBstd::_Deque_base\fP< _Tp, _Alloc >::_M_impl\fC [protected]\fP" A total of four data members accumulated down the hierarchy\&. May be accessed via _M_impl\&.* .PP Definition at line 651 of file stl_deque\&.h\&. .PP Referenced by std::deque< _Tp, _Alloc >::_M_reserve_elements_at_front(), std::deque< _Tp, _Alloc >::_M_reserve_map_at_back(), std::deque< _Tp, _Alloc >::begin(), std::deque< _Tp, _Alloc >::cbegin(), std::deque< _Tp, _Alloc >::cend(), std::deque< _Tp, _Alloc >::crbegin(), std::deque< _Tp, _Alloc >::crend(), std::deque< _Tp, _Alloc >::empty(), std::deque< _Tp, _Alloc >::end(), std::deque< _Tp, _Alloc >::push_back(), std::deque< _Tp, _Alloc >::push_front(), std::deque< _Tp, _Alloc >::rbegin(), std::deque< _Tp, _Alloc >::rend(), std::deque< _Tp, _Alloc >::resize(), and std::deque< _Tp, _Alloc >::size()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.