template<typename_Tp,typename_Alloc>voiddeque::_M_fill_initialize(constvalue_type&__value)[protected]
Fills the deque with copies of value.
Parameters__value Initial value.
Returns
Nothing.
Precondition
_M_start and _M_finish have already been initialized, but none of the deque's elements have yet been
constructed.
This function is called only when the user provides an explicit size (with or without an explicit
exemplar value).
References std::_Destroy().
Referenced by std::deque<_Tp,_Alloc>::deque().
template<typename_Tp,typename_Alloc>voiddeque::_M_new_elements_at_back(size_type__new_elements)[protected]
Memory-handling helpers for the previous internal insert functions.
References std::size().
Referenced by std::deque<_Tp,_Alloc>::_M_reserve_elements_at_back().
template<typename_Tp,typename_Alloc>voiddeque::_M_new_elements_at_front(size_type__new_elements)[protected]
Memory-handling helpers for the previous internal insert functions.
References std::size().
Referenced by std::deque<_Tp,_Alloc>::_M_reserve_elements_at_front().
template<typename_Tp,typename_Alloc>voiddeque::_M_pop_back_aux()[protected]
Helper functions for push_* and pop_*.
Referenced by std::deque<_Tp,_Alloc>::pop_back().
template<typename_Tp,typename_Alloc>voiddeque::_M_pop_front_aux()[protected]
Helper functions for push_* and pop_*.
Referenced by std::deque<_Tp,_Alloc>::pop_front().
template<typename_Tp,typename_Alloc>template<typename..._Args>voiddeque::_M_push_back_aux(_Args&&...__args)[protected]
Helper functions for push_* and pop_*.
References std::size().
Referenced by std::deque<_Tp,_Alloc>::push_back().
template<typename_Tp,typename_Alloc>template<typename..._Args>voiddeque::_M_push_front_aux(_Args&&...__args)[protected]
Helper functions for push_* and pop_*.
References std::size().
Referenced by std::deque<_Tp,_Alloc>::push_front().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::_M_range_check(size_type__n)const[inline],[protected]
Safety check used only from at().
References std::deque<_Tp,_Alloc>::size().
Referenced by std::deque<_Tp,_Alloc>::at(), and std::deque<_Tp,_Alloc>::at().
template<typename_Tp,typename_Alloc>template<typename_ForwardIterator>voiddeque::_M_range_initialize(_ForwardIterator__first,_ForwardIterator__last,std::forward_iterator_tag)[protected]
Fills the deque with whatever is in [first,last).
Parameters__first An input iterator.
__last An input iterator.
Returns
Nothing.
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.
References std::_Destroy(), std::advance(), and std::distance().
template<typename_Tp,typename_Alloc>template<typename_InputIterator>voiddeque::_M_range_initialize(_InputIterator__first,_InputIterator__last,std::input_iterator_tag)[protected]
Fills the deque with whatever is in [first,last).
Parameters__first An input iterator.
__last An input iterator.
Returns
Nothing.
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.
Referenced by std::deque<_Tp,_Alloc>::deque(), and std::deque<_Tp,_Alloc>::deque().
template<typename_Tp,typename_Alloc>voiddeque::_M_reallocate_map(size_type__nodes_to_add,bool__add_at_front)[protected]
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.)
References std::max().
Referenced by std::deque<_Tp,_Alloc>::_M_reserve_map_at_back(), and std::deque<_Tp,_Alloc>::_M_reserve_map_at_front().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::_M_reserve_elements_at_back(size_type__n)[inline],[protected]
Memory-handling helpers for the previous internal insert functions.
References std::deque<_Tp,_Alloc>::_M_new_elements_at_back().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::_M_reserve_elements_at_front(size_type__n)[inline],[protected]
Memory-handling helpers for the previous internal insert functions.
References std::deque<_Tp,_Alloc>::_M_new_elements_at_front().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::_M_reserve_map_at_back(size_type__nodes_to_add=1)[inline],[protected]
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.)
References std::deque<_Tp,_Alloc>::_M_reallocate_map().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::_M_reserve_map_at_front(size_type__nodes_to_add=1)[inline],[protected]
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.)
References std::deque<_Tp,_Alloc>::_M_reallocate_map().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>template<typename_InputIterator,typename=std::_RequireInputIter<_InputIterator>>voidstd::deque<_Tp,_Alloc>::assign(_InputIterator__first,_InputIterator__last)[inline]
Assigns a range to a deque.
Parameters__first An input iterator.
__last An input iterator.
This function fills a deque with copies of the elements in the range [__first,__last).
Note that the assignment completely changes the deque and that the resulting deque's size is the same as
the number of elements assigned.
References std::__iterator_category().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::assign(initializer_list<value_type>__l)[inline]
Assigns an initializer list to a deque.
Parameters__l An initializer_list.
This function fills a deque with copies of the elements in the initializer_list __l.
Note that the assignment completely changes the deque and that the resulting deque's size is the same as
the number of elements assigned.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::assign(size_type__n,constvalue_type&__val)[inline]
Assigns a given value to a deque.
Parameters__n Number of elements to be assigned.
__val Value to be assigned.
This function fills a deque with n 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.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>referencestd::deque<_Tp,_Alloc>::at(size_type__n)[inline]
Provides access to the data contained in the deque.
Parameters__n The index of the element for which data should be accessed.
Returns
Read/write reference to data.
Exceptionsstd::out_of_range If __n is an invalid index.
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.
References std::deque<_Tp,_Alloc>::_M_range_check().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_referencestd::deque<_Tp,_Alloc>::at(size_type__n)const[inline]
Provides access to the data contained in the deque.
Parameters__n The index of the element for which data should be accessed.
Returns
Read-only (constant) reference to data.
Exceptionsstd::out_of_range If __n is an invalid index.
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.
References std::deque<_Tp,_Alloc>::_M_range_check().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_referencestd::deque<_Tp,_Alloc>::back()const[inline],[noexcept]
Returns a read-only (constant) reference to the data at the last element of the deque.
References std::deque<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>referencestd::deque<_Tp,_Alloc>::back()[inline],[noexcept]
Returns a read/write reference to the data at the last element of the deque.
References std::deque<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_iteratorstd::deque<_Tp,_Alloc>::begin()const[inline],[noexcept]
Returns a read-only (constant) iterator that points to the first element in the deque. Iteration is done
in ordinary element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::begin()[inline],[noexcept]
Returns a read/write iterator that points to the first element in the deque. Iteration is done in
ordinary element order.
Referenced by std::deque<_Tp,_Alloc>::deque(), std::deque<_Tp,_Alloc>::deque(), std::deque<_Tp,_Alloc>::~deque(), std::deque<_Tp,_Alloc>::clear(), std::deque<_Tp,_Alloc>::front(), std::deque<_Tp,_Alloc>::front(), std::deque<_Tp,_Alloc>::insert(), std::deque<_Tp,_Alloc>::insert(),
std::deque<_Tp,_Alloc>::insert(), and std::deque<_Tp,_Alloc>::operator=().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_iteratorstd::deque<_Tp,_Alloc>::cbegin()const[inline],[noexcept]
Returns a read-only (constant) iterator that points to the first element in the deque. Iteration is done
in ordinary element order.
Referenced by std::deque<_Tp,_Alloc>::insert(), std::deque<_Tp,_Alloc>::insert(), and std::deque<_Tp,_Alloc>::insert().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_iteratorstd::deque<_Tp,_Alloc>::cend()const[inline],[noexcept]
Returns a read-only (constant) iterator that points one past the last element in the deque. Iteration is
done in ordinary element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::clear()[inline],[noexcept]
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.
References std::deque<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_reverse_iteratorstd::deque<_Tp,_Alloc>::crbegin()const[inline],[noexcept]
Returns a read-only (constant) reverse iterator that points to the last element in the deque. Iteration
is done in reverse element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_reverse_iteratorstd::deque<_Tp,_Alloc>::crend()const[inline],[noexcept]
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.
template<typename_Tp,typename_Alloc>template<typename..._Args>deque<_Tp,_Alloc>::iteratordeque::emplace(const_iterator__position,_Args&&...__args)
Inserts an object in deque before specified iterator.
Parameters__position A const_iterator into the deque.
__args Arguments.
Returns
An iterator that points to the inserted data.
This function will insert an object of type T constructed with T(std::forward<Args>(args)...) before the
specified location.
Referenced by std::deque<_Tp,_Alloc>::insert().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>boolstd::deque<_Tp,_Alloc>::empty()const[inline],[noexcept]
Returns true if the deque is empty. (Thus begin() would equal end().)
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_iteratorstd::deque<_Tp,_Alloc>::end()const[inline],[noexcept]
Returns a read-only (constant) iterator that points one past the last element in the deque. Iteration is
done in ordinary element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::end()[inline],[noexcept]
Returns a read/write iterator that points one past the last element in the deque. Iteration is done in
ordinary element order.
Referenced by std::deque<_Tp,_Alloc>::deque(), std::deque<_Tp,_Alloc>::deque(), std::deque<_Tp,_Alloc>::~deque(), std::deque<_Tp,_Alloc>::back(), std::deque<_Tp,_Alloc>::back(), and std::deque<_Tp,_Alloc>::operator=().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::erase(const_iterator__first,const_iterator__last)[inline]
Remove a range of elements.
Parameters__first Iterator pointing to the first element to be erased.
__last Iterator pointing to one past the last element to be erased.
Returns
An iterator pointing to the element pointed to by last prior to erasing (or end()).
This function will erase the elements in the range [__first,__last) and shorten the deque accordingly.
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.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::erase(const_iterator__position)[inline]
Remove element at given position.
Parameters__position Iterator pointing to element to be erased.
Returns
An iterator pointing to the next element (or end()).
This function will erase the element at the given position and thus shorten the deque by one.
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.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_referencestd::deque<_Tp,_Alloc>::front()const[inline],[noexcept]
Returns a read-only (constant) reference to the data at the first element of the deque.
References std::deque<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>referencestd::deque<_Tp,_Alloc>::front()[inline],[noexcept]
Returns a read/write reference to the data at the first element of the deque.
References std::deque<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>allocator_typestd::deque<_Tp,_Alloc>::get_allocator()const[inline],[noexcept]
Get a copy of the memory allocation object.
Referenced by std::deque<_Tp,_Alloc>::operator=().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::insert(const_iterator__p,initializer_list<value_type>__l)[inline]
Inserts an initializer list into the deque.
Parameters__p An iterator into the deque.
__l An initializer_list.
Returns
An iterator that points to the inserted data.
This function will insert copies of the data in the initializer_list __l into the deque before the
location specified by __p. This is known as listinsert.
References std::deque<_Tp,_Alloc>::begin(), and std::deque<_Tp,_Alloc>::cbegin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>template<typename_InputIterator,typename=std::_RequireInputIter<_InputIterator>>iteratorstd::deque<_Tp,_Alloc>::insert(const_iterator__position,_InputIterator__first,_InputIterator__last)[inline]
Inserts a range into the deque.
Parameters__position A const_iterator into the deque.
__first An input iterator.
__last An input iterator.
Returns
An iterator that points to the inserted data.
This function will insert copies of the data in the range [__first,__last) into the deque before the
location specified by __position. This is known as rangeinsert.
References std::__iterator_category(), std::deque<_Tp,_Alloc>::begin(), and std::deque<_Tp,_Alloc>::cbegin().
template<typename_Tp,typename_Alloc>deque<_Tp,_Alloc>::iteratordeque::insert(const_iterator__position,constvalue_type&__x)
Inserts given value into deque before specified iterator.
Parameters__position A const_iterator into the deque.
__x Data to be inserted.
Returns
An iterator that points to the inserted data.
This function will insert a copy of the given value before the specified location.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::insert(const_iterator__position,size_type__n,constvalue_type&__x)[inline]
Inserts a number of copies of given data into the deque.
Parameters__position A const_iterator into the deque.
__n Number of elements to be inserted.
__x Data to be inserted.
Returns
An iterator that points to the inserted data.
This function will insert a specified number of copies of the given data before the location specified by
__position.
References std::deque<_Tp,_Alloc>::begin(), and std::deque<_Tp,_Alloc>::cbegin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::deque<_Tp,_Alloc>::insert(const_iterator__position,value_type&&__x)[inline]
Inserts given rvalue into deque before specified iterator.
Parameters__position A const_iterator into the deque.
__x Data to be inserted.
Returns
An iterator that points to the inserted data.
This function will insert a copy of the given rvalue before the specified location.
References std::deque<_Tp,_Alloc>::emplace(), and std::move().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>size_typestd::deque<_Tp,_Alloc>::max_size()const[inline],[noexcept]
Returns the size() of the largest possible deque.
template<typename_Tp,typename_Alloc>deque<_Tp,_Alloc>&deque::operator=(constdeque<_Tp,_Alloc>&__x)
Deque assignment operator.
Parameters__x A deque of identical element and allocator types.
All the elements of x are copied.
The newly-created deque uses a copy of the allocator object used by __x (unless the allocator traits
dictate a different object).
References std::__addressof(), std::deque<_Tp,_Alloc>::begin(), std::deque<_Tp,_Alloc>::end(),
std::deque<_Tp,_Alloc>::get_allocator(), std::deque<_Tp,_Alloc>::size(), and std::size().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>deque&std::deque<_Tp,_Alloc>::operator=(deque<_Tp,_Alloc>&&__x)[inline],[noexcept]
Deque move assignment operator.
Parameters__x A deque of identical element and allocator types.
The contents of __x are moved into this deque (without copying, if the allocators permit it). __x is a
valid, but unspecified deque.
References std::move().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>deque&std::deque<_Tp,_Alloc>::operator=(initializer_list<value_type>__l)[inline]
Assigns an initializer list to a deque.
Parameters__l An initializer_list.
This function fills a deque with copies of the elements in the initializer_list __l.
Note that the assignment completely changes the deque and that the resulting deque's size is the same as
the number of elements assigned.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_referencestd::deque<_Tp,_Alloc>::operator[](size_type__n)const[inline],[noexcept]
Subscript access to the data contained in the deque.
Parameters__n The index of the element for which data should be accessed.
Returns
Read-only (constant) reference to data.
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().)
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>referencestd::deque<_Tp,_Alloc>::operator[](size_type__n)[inline],[noexcept]
Subscript access to the data contained in the deque.
Parameters__n The index of the element for which data should be accessed.
Returns
Read/write reference to data.
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().)
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::pop_back()[inline],[noexcept]
Removes last element. This is a typical stack operation. It shrinks the deque by one.
Note that no data is returned, and if the last element's data is needed, it should be retrieved before
pop_back() is called.
References std::deque<_Tp,_Alloc>::_M_pop_back_aux().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::pop_front()[inline],[noexcept]
Removes first element. This is a typical stack operation. It shrinks the deque by one.
Note that no data is returned, and if the first element's data is needed, it should be retrieved before
pop_front() is called.
References std::deque<_Tp,_Alloc>::_M_pop_front_aux().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::push_back(constvalue_type&__x)[inline]
Add data to the end of the deque.
Parameters__x Data to be added.
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.
References std::deque<_Tp,_Alloc>::_M_push_back_aux().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::push_front(constvalue_type&__x)[inline]
Add data to the front of the deque.
Parameters__x Data to be added.
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.
References std::deque<_Tp,_Alloc>::_M_push_front_aux().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_reverse_iteratorstd::deque<_Tp,_Alloc>::rbegin()const[inline],[noexcept]
Returns a read-only (constant) reverse iterator that points to the last element in the deque. Iteration
is done in reverse element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>reverse_iteratorstd::deque<_Tp,_Alloc>::rbegin()[inline],[noexcept]
Returns a read/write reverse iterator that points to the last element in the deque. Iteration is done in
reverse element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_reverse_iteratorstd::deque<_Tp,_Alloc>::rend()const[inline],[noexcept]
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.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>reverse_iteratorstd::deque<_Tp,_Alloc>::rend()[inline],[noexcept]
Returns a read/write reverse iterator that points to one before the first element in the deque. Iteration
is done in reverse element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::resize(size_type__new_size)[inline]
Resizes the deque to the specified number of elements.
Parameters__new_size Number of elements the deque should contain.
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.
References std::deque<_Tp,_Alloc>::size().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::resize(size_type__new_size,constvalue_type&__x)[inline]
Resizes the deque to the specified number of elements.
Parameters__new_size Number of elements the deque should contain.
__x Data with which new elements should be populated.
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.
References std::deque<_Tp,_Alloc>::size().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::shrink_to_fit()[inline],[noexcept]
A non-binding request to reduce memory use.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>size_typestd::deque<_Tp,_Alloc>::size()const[inline],[noexcept]
Returns the number of elements in the deque.
Referenced by std::deque<_Tp,_Alloc>::_M_range_check(), std::deque<_Tp,_Alloc>::operator=(),
std::deque<_Tp,_Alloc>::resize(), and std::deque<_Tp,_Alloc>::resize().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::deque<_Tp,_Alloc>::swap(deque<_Tp,_Alloc>&__x)[inline],[noexcept]
Swaps data with another deque.
Parameters__x A deque of the same element and allocator types.
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.
Whether the allocators are swapped depends on the allocator traits.