|
libstdc++
|
#include <stl_deque.h>
Public Types | |
| typedef _Alloc | allocator_type |
| typedef _Base::const_iterator | const_iterator |
| typedef _Alloc_traits::const_pointer | const_pointer |
| typedef _Alloc_traits::const_reference | const_reference |
| typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
| typedef ptrdiff_t | difference_type |
| typedef _Base::iterator | iterator |
| typedef _Alloc_traits::pointer | pointer |
| typedef _Alloc_traits::reference | reference |
| typedef std::reverse_iterator< iterator > | reverse_iterator |
| typedef size_t | size_type |
| typedef _Tp | value_type |
Public Member Functions | |
| deque ()=default | |
| template<typename _InputIterator, typename = std::_RequireInputIter<_InputIterator>> | |
| constexpr | deque (_InputIterator __first, _InputIterator __last, const allocator_type &__a=allocator_type()) |
| constexpr | deque (const allocator_type &__a) |
| constexpr | deque (const deque &__x) |
| constexpr | deque (const deque &__x, const __type_identity_t< allocator_type > &__a) |
| deque (deque &&)=default | |
| constexpr | deque (deque &&__x, const __type_identity_t< allocator_type > &__a) |
| constexpr | deque (initializer_list< value_type > __l, const allocator_type &__a=allocator_type()) |
| constexpr | deque (size_type __n, const allocator_type &__a=allocator_type()) |
| constexpr | deque (size_type __n, const value_type &__value, const allocator_type &__a=allocator_type()) |
| constexpr | ~deque () |
| template<typename _InputIterator, typename = std::_RequireInputIter<_InputIterator>> | |
| constexpr void | assign (_InputIterator __first, _InputIterator __last) |
| constexpr void | assign (initializer_list< value_type > __l) |
| constexpr void | assign (size_type __n, const value_type &__val) |
| constexpr reference | at (size_type __n) |
| constexpr const_reference | at (size_type __n) const |
| constexpr const_reference | back () const noexcept |
| constexpr reference | back () noexcept |
| constexpr const_iterator | begin () const noexcept |
| constexpr iterator | begin () noexcept |
| constexpr const_iterator | cbegin () const noexcept |
| constexpr const_iterator | cend () const noexcept |
| constexpr void | clear () noexcept |
| constexpr const_reverse_iterator | crbegin () const noexcept |
| constexpr const_reverse_iterator | crend () const noexcept |
| template<typename... _Args> | |
| constexpr iterator | emplace (const_iterator __position, _Args &&... __args) |
| template<typename... _Args> | |
| constexpr reference | emplace_back (_Args &&... __args) |
| template<typename... _Args> | |
| constexpr reference | emplace_front (_Args &&... __args) |
| constexpr bool | empty () const noexcept |
| constexpr const_iterator | end () const noexcept |
| constexpr iterator | end () noexcept |
| constexpr iterator | erase (const_iterator __first, const_iterator __last) |
| constexpr iterator | erase (const_iterator __position) |
| constexpr const_reference | front () const noexcept |
| constexpr reference | front () noexcept |
| constexpr allocator_type | get_allocator () const noexcept |
| constexpr iterator | insert (const_iterator __p, initializer_list< value_type > __l) |
| template<typename _InputIterator, typename = std::_RequireInputIter<_InputIterator>> | |
| constexpr iterator | insert (const_iterator __position, _InputIterator __first, _InputIterator __last) |
| constexpr iterator | insert (const_iterator __position, const value_type &__x) |
| constexpr iterator | insert (const_iterator __position, size_type __n, const value_type &__x) |
| constexpr iterator | insert (const_iterator __position, value_type &&__x) |
| constexpr size_type | max_size () const noexcept |
| constexpr deque & | operator= (const deque &__x) |
| constexpr deque & | operator= (deque &&__x) noexcept(_Alloc_traits::_S_always_equal()) |
| constexpr deque & | operator= (initializer_list< value_type > __l) |
| constexpr const_reference | operator[] (size_type __n) const noexcept |
| constexpr reference | operator[] (size_type __n) noexcept |
| constexpr void | pop_back () noexcept |
| constexpr void | pop_front () noexcept |
| constexpr void | push_back (const value_type &__x) |
| constexpr void | push_back (value_type &&__x) |
| constexpr void | push_front (const value_type &__x) |
| constexpr void | push_front (value_type &&__x) |
| constexpr const_reverse_iterator | rbegin () const noexcept |
| constexpr reverse_iterator | rbegin () noexcept |
| constexpr const_reverse_iterator | rend () const noexcept |
| constexpr reverse_iterator | rend () noexcept |
| constexpr void | resize (size_type __new_size) |
| constexpr void | resize (size_type __new_size, const value_type &__x) |
| constexpr void | shrink_to_fit () noexcept |
| constexpr size_type | size () const noexcept |
| constexpr void | swap (deque &__x) noexcept |
Protected Types | |
| enum | { _S_initial_map_size } |
| typedef __gnu_cxx::__alloc_traits< _Map_alloc_type > | _Map_alloc_traits |
| typedef _Alloc_traits::template rebind< _Ptr >::other | _Map_alloc_type |
| typedef _Alloc_traits::pointer | _Ptr |
| typedef _Alloc_traits::const_pointer | _Ptr_const |
Protected Member Functions | |
| template<typename _ForwardIterator> | |
| constexpr void | _M_assign_aux (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) |
| template<typename _InputIterator> | |
| constexpr void | _M_assign_aux (_InputIterator __first, _InputIterator __last, std::input_iterator_tag) |
| constexpr void | _M_deallocate_map (_Map_pointer __p, size_t __n) noexcept |
| constexpr void | _M_default_append (size_type __n) |
| constexpr void | _M_default_initialize () |
| template<typename _Alloc1> | |
| constexpr void | _M_destroy_data (iterator __first, iterator __last, const _Alloc1 &) |
| constexpr void | _M_destroy_data (iterator __first, iterator __last, const std::allocator< _Tp > &) |
| constexpr void | _M_destroy_data_aux (iterator __first, iterator __last) |
| template<typename... _Args> | |
| constexpr iterator | _M_emplace_aux (iterator __pos, _Args &&... __args) |
| constexpr iterator | _M_erase (iterator __first, iterator __last) |
| constexpr iterator | _M_erase (iterator __pos) |
| constexpr void | _M_erase_at_begin (iterator __pos) |
| constexpr void | _M_erase_at_end (iterator __pos) |
| constexpr void | _M_fill_assign (size_type __n, const value_type &__val) |
| constexpr void | _M_fill_initialize (const value_type &__value) |
| constexpr void | _M_fill_insert (iterator __pos, size_type __n, const value_type &__x) |
| constexpr _Map_alloc_type | _M_get_map_allocator () const noexcept |
| template<typename _ForwardIterator> | |
| constexpr void | _M_insert_aux (iterator __pos, _ForwardIterator __first, _ForwardIterator __last, size_type __n) |
| constexpr iterator | _M_insert_aux (iterator __pos, const value_type &__x) |
| constexpr void | _M_insert_aux (iterator __pos, size_type __n, const value_type &__x) |
| constexpr void | _M_move_assign1 (deque &&__x, false_type) |
| constexpr void | _M_move_assign1 (deque &&__x, true_type) noexcept |
| constexpr void | _M_move_assign2 (deque &&__x, false_type) |
| constexpr void | _M_move_assign2 (deque &&__x, true_type) |
| template<typename _InputIterator, typename _Sentinel> | |
| constexpr void | _M_range_append (_InputIterator __first, _Sentinel __last, size_type __n) |
| constexpr void | _M_range_check (size_type __n) const |
| template<typename _ForwardIterator> | |
| constexpr void | _M_range_insert_aux (iterator __pos, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) |
| template<typename _InputIterator> | |
| constexpr void | _M_range_insert_aux (iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag) |
| template<typename _InputIterator, typename _Sentinel> | |
| constexpr void | _M_range_prepend (_InputIterator __first, _Sentinel __last, size_type __n) |
| template<typename... _Args> | |
| constexpr void | _M_replace_map (_Args &&... __args) |
| constexpr bool | _M_shrink_to_fit () |
| template<typename _InputIterator> | |
| constexpr void | _M_range_initialize (_InputIterator __first, _InputIterator __last, std::input_iterator_tag) |
| template<typename _ForwardIterator> | |
| constexpr void | _M_range_initialize (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) |
| template<typename... _Args> | |
| constexpr void | _M_push_back_aux (_Args &&... __args) |
| template<typename... _Args> | |
| constexpr void | _M_push_front_aux (_Args &&... __args) |
| constexpr void | _M_pop_back_aux () |
| constexpr void | _M_pop_front_aux () |
| constexpr iterator | _M_reserve_elements_at_front (size_type __n) |
| constexpr iterator | _M_reserve_elements_at_back (size_type __n) |
| constexpr void | _M_new_elements_at_front (size_type __new_elements) |
| constexpr void | _M_new_elements_at_back (size_type __new_elements) |
| constexpr void | _M_reserve_map_at_back (size_type __nodes_to_add=1) |
| constexpr void | _M_reserve_map_at_front (size_type __nodes_to_add=1) |
| constexpr void | _M_reallocate_map (size_type __nodes_to_add, bool __add_at_front) |
Static Protected Member Functions | |
| static constexpr size_t | _S_check_init_len (size_t __n, const allocator_type &__a) |
| static constexpr size_type | _S_max_size (const _Tp_alloc_type &__a) noexcept |
A standard container using fixed-size memory allocation and constant-time manipulation of elements at either end.
| _Tp | Type of element. |
| _Alloc | Allocator type, defaults to allocator<_Tp>. |
Meets the requirements of a container, a reversible container, and a sequence, including the optional sequence requirements.
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.
Here's how a deque<Tp> manages memory. Each deque has 4 members:
map_size is at least 8. map is an array of map_size pointers-to-nodes. (The name map has nothing to do with the std::map class, and nodes should not be confused with std::list's usage of node.)
A node has no specific type name as such, but it is referred to as node 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 array 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.
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 outward.
Class invariants:
A pointer in the range [map, map + map_size) points to an allocated node if and only if the pointer is in the range [start.node, finish.node].
Here's the magic: nothing in deque is aware of the discontiguous storage!
The memory setup and layout occurs in the parent, _Base, and the iterator class is entirely responsible for leaping from one node to the next. All the implementation routines for deque itself work only through the start and finish iterators. This keeps the routines simple and sane, and we can use other standard algorithms as well.
Definition at line 853 of file stl_deque.h.
|
protectedinherited |
Definition at line 492 of file stl_deque.h.
|
protectedinherited |
Definition at line 491 of file stl_deque.h.
|
protectedinherited |
Definition at line 486 of file stl_deque.h.
|
protectedinherited |
Definition at line 487 of file stl_deque.h.
| typedef _Alloc std::deque< _Tp, _Alloc >::allocator_type |
Definition at line 890 of file stl_deque.h.
| typedef _Base::const_iterator std::deque< _Tp, _Alloc >::const_iterator |
Definition at line 885 of file stl_deque.h.
| typedef _Alloc_traits::const_pointer std::deque< _Tp, _Alloc >::const_pointer |
Definition at line 881 of file stl_deque.h.
| typedef _Alloc_traits::const_reference std::deque< _Tp, _Alloc >::const_reference |
Definition at line 883 of file stl_deque.h.
| typedef std::reverse_iterator<const_iterator> std::deque< _Tp, _Alloc >::const_reverse_iterator |
Definition at line 886 of file stl_deque.h.
| typedef ptrdiff_t std::deque< _Tp, _Alloc >::difference_type |
Definition at line 889 of file stl_deque.h.
| typedef _Base::iterator std::deque< _Tp, _Alloc >::iterator |
Definition at line 884 of file stl_deque.h.
| typedef _Alloc_traits::pointer std::deque< _Tp, _Alloc >::pointer |
Definition at line 880 of file stl_deque.h.
| typedef _Alloc_traits::reference std::deque< _Tp, _Alloc >::reference |
Definition at line 882 of file stl_deque.h.
| typedef std::reverse_iterator<iterator> std::deque< _Tp, _Alloc >::reverse_iterator |
Definition at line 887 of file stl_deque.h.
| typedef size_t std::deque< _Tp, _Alloc >::size_type |
Definition at line 888 of file stl_deque.h.
| typedef _Tp std::deque< _Tp, _Alloc >::value_type |
Definition at line 879 of file stl_deque.h.
|
protectedinherited |
Definition at line 676 of file stl_deque.h.
|
default |
Creates a deque with no elements.
Referenced by insert(), and operator=().
|
inlineexplicitconstexpr |
Creates a deque with no elements.
| __a | An allocator object. |
Definition at line 931 of file stl_deque.h.
|
inlineexplicitconstexpr |
Creates a deque with default constructed elements.
| __n | The number of elements to initially create. |
| __a | An allocator. |
This constructor fills the deque with n default constructed elements.
Definition at line 944 of file stl_deque.h.
|
inlineconstexpr |
Creates a deque with copies of an exemplar element.
| __n | The number of elements to initially create. |
| __value | An element to copy. |
| __a | An allocator. |
This constructor fills the deque with __n copies of __value.
Definition at line 957 of file stl_deque.h.
|
inlineconstexpr |
Deque copy constructor.
| __x | A deque of identical element and allocator types. |
The newly-created deque uses a copy of the allocator object used by __x (unless the allocator traits dictate a different object).
Definition at line 985 of file stl_deque.h.
|
default |
Deque move constructor.
The newly-created deque contains the exact contents of the moved instance. The contents of the moved instance are a valid, but unspecified deque.
|
inlineconstexpr |
Copy constructor with alternative allocator.
Definition at line 1005 of file stl_deque.h.
|
inlineconstexpr |
Move constructor with alternative allocator.
Definition at line 1013 of file stl_deque.h.
|
inlineconstexpr |
Builds a deque from an initializer list.
| __l | An initializer_list. |
| __a | An allocator object. |
Create a deque consisting of copies of the elements in the initializer_list __l.
This will call the element type's copy constructor N times (where N is __l.size()) and do no memory reallocation.
Definition at line 1049 of file stl_deque.h.
|
inlineconstexpr |
Builds a deque from a range.
| __first | An input iterator. |
| __last | An input iterator. |
| __a | An allocator object. |
Create a deque consisting of copies of the elements from [__first, __last).
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.
Definition at line 1077 of file stl_deque.h.
|
inlineconstexpr |
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.
Definition at line 1115 of file stl_deque.h.
|
inlineconstexprprotected |
Definition at line 2127 of file stl_deque.h.
|
constexprprotected |
|
inlineconstexprprotectednoexceptinherited |
Definition at line 660 of file stl_deque.h.
|
constexprprotected |
|
constexprprotected |
|
inlineconstexprprotected |
Definition at line 2303 of file stl_deque.h.
|
inlineconstexprprotected |
Definition at line 2307 of file stl_deque.h.
|
constexprprotected |
|
constexprprotected |
|
constexprprotected |
|
constexprprotected |
|
inlineconstexprprotected |
Definition at line 2316 of file stl_deque.h.
|
inlineconstexprprotected |
Definition at line 2326 of file stl_deque.h.
|
inlineconstexprprotected |
Definition at line 2146 of file stl_deque.h.
|
constexprprotected |
Fills the deque with copies of value.
| __value | Initial value. |
This function is called only when the user provides an explicit size (with or without an explicit exemplar value).
Definition at line 400 of file deque.tcc.
References std::_Destroy().
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::deque().
|
constexprprotected |
|
inlineconstexprprotectednoexceptinherited |
Definition at line 635 of file stl_deque.h.
|
constexprprotected |
|
inlineconstexprprotected |
Definition at line 2274 of file stl_deque.h.
|
constexprprotected |
|
inlineconstexprprotected |
Definition at line 2422 of file stl_deque.h.
|
inlineconstexprprotectednoexcept |
Definition at line 2411 of file stl_deque.h.
|
inlineconstexprprotected |
Definition at line 2466 of file stl_deque.h.
|
inlineconstexprprotected |
Definition at line 2452 of file stl_deque.h.
|
constexprprotected |
Memory-handling helpers for the previous internal insert functions.
Definition at line 1095 of file deque.tcc.
References _M_reserve_map_at_back(), max_size(), and std::size().
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::_M_reserve_elements_at_back().
|
constexprprotected |
Memory-handling helpers for the previous internal insert functions.
Definition at line 1070 of file deque.tcc.
References _M_reserve_map_at_front(), max_size(), and std::size().
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::_M_reserve_elements_at_front().
|
constexprprotected |
Helper functions for push_* and pop_*.
Definition at line 568 of file deque.tcc.
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::pop_back().
|
constexprprotected |
Helper functions for push_* and pop_*.
Definition at line 585 of file deque.tcc.
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::pop_front().
|
constexprprotected |
Helper functions for push_* and pop_*.
Definition at line 491 of file deque.tcc.
References _M_reserve_map_at_back(), std::forward(), max_size(), and std::size().
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::push_back().
|
constexprprotected |
Helper functions for push_* and pop_*.
Definition at line 530 of file deque.tcc.
References _M_reserve_map_at_front(), std::forward(), max_size(), and std::size().
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::push_front().
|
constexprprotected |
|
inlineconstexprprotected |
Safety check used only from at().
Definition at line 1533 of file stl_deque.h.
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::at(), and std::deque< _Tp, polymorphic_allocator< _Tp > >::at().
|
constexprprotected |
Fills the deque with whatever is in [first,last).
| __first | An input iterator. |
| __last | An input iterator. |
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.
Definition at line 450 of file deque.tcc.
References std::_Destroy(), std::advance(), and std::distance().
|
constexprprotected |
Fills the deque with whatever is in [first,last).
| __first | An input iterator. |
| __last | An input iterator. |
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.
Definition at line 426 of file deque.tcc.
References clear(), and push_back().
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::deque(), and std::deque< _Tp, polymorphic_allocator< _Tp > >::deque().
|
constexprprotected |
|
constexprprotected |
|
constexprprotected |
|
constexprprotected |
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.)
Definition at line 1120 of file deque.tcc.
References std::max(), and max_size().
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::_M_reserve_map_at_back(), and std::deque< _Tp, polymorphic_allocator< _Tp > >::_M_reserve_map_at_front().
|
inlineconstexprprotected |
Definition at line 2436 of file stl_deque.h.
|
inlineconstexprprotected |
Memory-handling helpers for the previous internal insert functions.
Definition at line 2362 of file stl_deque.h.
|
inlineconstexprprotected |
Memory-handling helpers for the previous internal insert functions.
Definition at line 2352 of file stl_deque.h.
|
inlineconstexprprotected |
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.)
Definition at line 2388 of file stl_deque.h.
Referenced by _M_new_elements_at_back(), and _M_push_back_aux().
|
inlineconstexprprotected |
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.)
Definition at line 2396 of file stl_deque.h.
Referenced by _M_new_elements_at_front(), and _M_push_front_aux().
|
constexprprotected |
|
inlinestaticconstexprprotected |
Definition at line 2040 of file stl_deque.h.
|
inlinestaticconstexprprotectednoexcept |
Definition at line 2049 of file stl_deque.h.
|
inlineconstexpr |
Assigns a range to a deque.
| __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.
Definition at line 1197 of file stl_deque.h.
|
inlineconstexpr |
Assigns an initializer list to a deque.
| __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.
Definition at line 1222 of file stl_deque.h.
|
inlineconstexpr |
Assigns a given value to a deque.
| __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.
Definition at line 1178 of file stl_deque.h.
|
inlineconstexpr |
Provides access to the data contained in the deque.
| __n | The index of the element for which data should be accessed. |
| std::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.
Definition at line 1555 of file stl_deque.h.
|
inlineconstexpr |
Provides access to the data contained in the deque.
| __n | The index of the element for which data should be accessed. |
| std::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.
Definition at line 1573 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read-only (constant) reference to the data at the last element of the deque.
Definition at line 1623 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read/write reference to the data at the last element of the deque.
Definition at line 1609 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read-only (constant) iterator that points to the first element in the deque. Iteration is done in ordinary element order.
Definition at line 1295 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read/write iterator that points to the first element in the deque. Iteration is done in ordinary element order.
Definition at line 1286 of file stl_deque.h.
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::deque(), std::deque< _Tp, polymorphic_allocator< _Tp > >::deque(), std::deque< _Tp, polymorphic_allocator< _Tp > >::~deque(), std::deque< _Tp, polymorphic_allocator< _Tp > >::clear(), std::deque< _Tp, polymorphic_allocator< _Tp > >::front(), std::deque< _Tp, polymorphic_allocator< _Tp > >::front(), std::deque< _Tp, polymorphic_allocator< _Tp > >::insert(), std::deque< _Tp, polymorphic_allocator< _Tp > >::insert(), std::deque< _Tp, polymorphic_allocator< _Tp > >::insert(), std::operator<=>(), operator=(), and std::operator==().
|
inlineconstexprnoexcept |
Returns a read-only (constant) iterator that points to the first element in the deque. Iteration is done in ordinary element order.
Definition at line 1365 of file stl_deque.h.
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::insert(), std::deque< _Tp, polymorphic_allocator< _Tp > >::insert(), and std::deque< _Tp, polymorphic_allocator< _Tp > >::insert().
|
inlineconstexprnoexcept |
Returns a read-only (constant) iterator that points one past the last element in the deque. Iteration is done in ordinary element order.
Definition at line 1375 of file stl_deque.h.
|
inlineconstexprnoexcept |
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.
Definition at line 2008 of file stl_deque.h.
Referenced by _M_range_initialize().
|
inlineconstexprnoexcept |
Returns a read-only (constant) reverse iterator that points to the last element in the deque. Iteration is done in reverse element order.
Definition at line 1385 of file stl_deque.h.
|
inlineconstexprnoexcept |
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.
Definition at line 1395 of file stl_deque.h.
|
constexpr |
Inserts an object in deque before specified iterator.
| __position | A const_iterator into the deque. |
| __args | Arguments. |
This function will insert an object of type T constructed with T(std::forward<Args>(args)...) before the specified location.
Definition at line 191 of file deque.tcc.
References std::forward().
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::insert().
|
constexpr |
|
constexpr |
|
inlinenodiscardconstexprnoexcept |
Returns true if the deque is empty. (Thus begin() would equal end().)
Definition at line 1488 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read-only (constant) iterator that points one past the last element in the deque. Iteration is done in ordinary element order.
Definition at line 1315 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read/write iterator that points one past the last element in the deque. Iteration is done in ordinary element order.
Definition at line 1305 of file stl_deque.h.
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::deque(), std::deque< _Tp, polymorphic_allocator< _Tp > >::deque(), std::deque< _Tp, polymorphic_allocator< _Tp > >::~deque(), std::deque< _Tp, polymorphic_allocator< _Tp > >::back(), std::deque< _Tp, polymorphic_allocator< _Tp > >::back(), std::operator<=>(), operator=(), and std::operator==().
|
inlineconstexpr |
Remove a range of elements.
| __first | Iterator pointing to the first element to be erased. |
| __last | Iterator pointing to one past the last element to be erased. |
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.
Definition at line 1972 of file stl_deque.h.
|
inlineconstexpr |
Remove element at given position.
| __position | Iterator pointing to element to be erased. |
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.
Definition at line 1948 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read-only (constant) reference to the data at the first element of the deque.
Definition at line 1597 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read/write reference to the data at the first element of the deque.
Definition at line 1585 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Get a copy of the memory allocation object.
Definition at line 1276 of file stl_deque.h.
Referenced by operator=().
|
inlineconstexpr |
Inserts an initializer list into the deque.
| __p | An iterator into the deque. |
| __l | An initializer_list. |
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 list insert.
Definition at line 1816 of file stl_deque.h.
|
inlineconstexpr |
Inserts a range into the deque.
| __position | A const_iterator into the deque. |
| __first | An input iterator. |
| __last | An input iterator. |
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 range insert.
Definition at line 1871 of file stl_deque.h.
|
constexpr |
Inserts given value into deque before specified iterator.
| __position | A const_iterator into the deque. |
| __x | Data to be inserted. |
This function will insert a copy of the given value before the specified location.
Definition at line 215 of file deque.tcc.
References deque(), insert(), push_back(), and push_front().
Referenced by insert().
|
inlineconstexpr |
Inserts a number of copies of given data into the deque.
| __position | A const_iterator into the deque. |
| __n | Number of elements to be inserted. |
| __x | Data to be inserted. |
This function will insert a specified number of copies of the given data before the location specified by __position.
Definition at line 1835 of file stl_deque.h.
|
inlineconstexpr |
Inserts given rvalue into deque before specified iterator.
| __position | A const_iterator into the deque. |
| __x | Data to be inserted. |
This function will insert a copy of the given rvalue before the specified location.
Definition at line 1802 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns the size() of the largest possible deque.
Definition at line 1414 of file stl_deque.h.
Referenced by _M_new_elements_at_back(), _M_new_elements_at_front(), _M_push_back_aux(), _M_push_front_aux(), and _M_reallocate_map().
|
constexpr |
Deque assignment operator.
| __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).
Definition at line 96 of file deque.tcc.
References deque(), std::__addressof(), begin(), end(), get_allocator(), size(), and std::size().
|
inlineconstexprnoexcept |
Deque move assignment operator.
| __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.
Definition at line 1140 of file stl_deque.h.
|
inlineconstexpr |
Assigns an initializer list to a deque.
| __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.
Definition at line 1159 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Subscript access to the data contained in the deque.
| __n | The index of the element for which data should be accessed. |
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().)
Definition at line 1524 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Subscript access to the data contained in the deque.
| __n | The index of the element for which data should be accessed. |
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().)
Definition at line 1505 of file stl_deque.h.
|
inlineconstexprnoexcept |
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.
Definition at line 1738 of file stl_deque.h.
|
inlineconstexprnoexcept |
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.
Definition at line 1715 of file stl_deque.h.
|
inlineconstexpr |
Add data to the end of the deque.
| __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.
Definition at line 1679 of file stl_deque.h.
Referenced by _M_range_initialize(), and insert().
|
inlineconstexpr |
Definition at line 1694 of file stl_deque.h.
|
inlineconstexpr |
Add data to the front of the deque.
| __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.
Definition at line 1642 of file stl_deque.h.
Referenced by insert().
|
inlineconstexpr |
Definition at line 1657 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read-only (constant) reverse iterator that points to the last element in the deque. Iteration is done in reverse element order.
Definition at line 1335 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read/write reverse iterator that points to the last element in the deque. Iteration is done in reverse element order.
Definition at line 1325 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
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.
Definition at line 1355 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns a read/write reverse iterator that points to one before the first element in the deque. Iteration is done in reverse element order.
Definition at line 1345 of file stl_deque.h.
|
inlineconstexpr |
Resizes the deque to the specified number of elements.
| __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.
Definition at line 1428 of file stl_deque.h.
|
inlineconstexpr |
Resizes the deque to the specified number of elements.
| __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.
Definition at line 1450 of file stl_deque.h.
|
inlineconstexprnoexcept |
A non-binding request to reduce memory use.
Definition at line 1478 of file stl_deque.h.
|
inlinenodiscardconstexprnoexcept |
Returns the number of elements in the deque.
Definition at line 1403 of file stl_deque.h.
Referenced by std::deque< _Tp, polymorphic_allocator< _Tp > >::_M_range_check(), operator=(), std::operator==(), std::deque< _Tp, polymorphic_allocator< _Tp > >::resize(), and std::deque< _Tp, polymorphic_allocator< _Tp > >::resize().
|
inlineconstexprnoexcept |
Swaps data with another deque.
| __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.
Definition at line 1990 of file stl_deque.h.