# std::__debug::deque< _Tp, _Allocator > Class Template Reference

Inheritance diagram for std::__debug::deque< _Tp, _Allocator >:

List of all members.

## Detailed Description

### template<typename _Tp, typename _Allocator = std::allocator<_Tp>>
class std::__debug::deque< _Tp, _Allocator >

Definition at line 47 of file debug/deque.

## Public Types

- typedef _Allocator allocator_type
- typedef __gnu_debug::_Safe_iterator<
  typename _Base::const_iterator,
  deque > const_iterator
- typedef _Base::const_pointer const_pointer
- typedef _Base::const_reference const_reference
- typedef std::reverse_iterator<
  const_iterator > const_reverse_iterator
- typedef _Base::difference_type difference_type
- typedef __gnu_debug::_Safe_iterator<
  typename _Base::iterator,
  deque > iterator
- typedef _Base::pointer pointer
- typedef _Base::reference reference
- typedef std::reverse_iterator<
  iterator > reverse_iterator
- typedef _Base::size_type size_type
- typedef _Tp value_type

## Public Member Functions

- const _Base & _M_base () const
- _Base & _M_base ()
- void _M_invalidate_all () const
- template<typename _Predicate> void _M_invalidate_if (_Predicate __pred)
- template<typename _Iterator> void _M_transfer_iter (const _Safe_iterator< _Iterator, _Sequence > &__x)
- void assign (size_type __n, const _Tp &__t)
- template<class _InputIterator> void assign (_InputIterator __first, _InputIterator __last)
- const_reference at (size_type __n) const
- reference at (size_type __n)
- const_reference back () const
- reference back ()
- const_iterator begin () const
- iterator begin ()
- void clear ()
- deque (const _Base &__x)
- deque (const deque< _Tp, _Allocator > &__x)
- template<class _InputIterator> deque (_InputIterator __first, _InputIterator __last, const _Allocator &__a=_Allocator())
- deque (size_type __n, const _Tp &__value=_Tp(), const _Allocator &__a=_Allocator())
- deque (const _Allocator &__a=_Allocator())
- bool empty () const
- const_iterator end () const
- iterator end ()
- iterator erase (iterator __first, iterator __last)
- iterator erase (iterator __position)
- iterator erase (iterator __first, iterator __last)
- iterator erase (iterator __position)
- const_reference front () const
- reference front ()
- allocator_type get_allocator () const
- void insert (iterator __position, _InputIterator __first, _InputIterator __last)
- void insert (iterator __position, size_type __n, const value_type &__x)
- iterator insert (iterator __position, const value_type &__x)
- template<class _InputIterator> void insert (iterator __position, _InputIterator __first, _InputIterator __last)
- void insert (iterator __position, size_type __n, const _Tp &__x)
- iterator insert (iterator __position, const _Tp &__x)
- size_type max_size () const
- deque< _Tp, _Allocator > & operator= (const deque< _Tp, _Allocator > &__x)
- const_reference operator[] (size_type __n) const
- reference operator[] (size_type __n)
- void pop_back ()
- void pop_front ()
- void push_back (const _Tp &__x)
- void push_front (const _Tp &__x)
- const_reverse_iterator rbegin () const
- reverse_iterator rbegin ()
- const_reverse_iterator rend () const
- reverse_iterator rend ()
- void resize (size_type __sz, _Tp __c=_Tp())
- size_type size () const
- void swap (deque &__x)
- void swap (deque< _Tp, _Allocator > &__x)
- ~deque ()

## Public Attributes

- _Safe_iterator_base * _M_const_iterators
- _Safe_iterator_base * _M_iterators
- unsigned int _M_version

## Protected Types

- enum
- typedef _Allocator::template
  rebind< _Tp * >::other _Map_alloc_type
- typedef pointer * _Map_pointer

## Protected Member Functions

- _Tp ** _M_allocate_map (size_t __n)
- _Tp * _M_allocate_node ()
- void _M_assign_aux (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
- void _M_assign_aux (_InputIterator __first, _InputIterator __last, std::input_iterator_tag)
- void _M_assign_dispatch (_InputIterator __first, _InputIterator __last, __false_type)
- void _M_assign_dispatch (_Integer __n, _Integer __val, __true_type)
- void _M_create_nodes (_Tp **__nstart, _Tp **__nfinish)
- void _M_deallocate_map (_Tp **__p, size_t __n)
- void _M_deallocate_node (_Tp *__p)
- void _M_destroy_data (iterator __first, iterator __last, const std::allocator< _Tp > &)
- void _M_destroy_data (iterator __first, iterator __last, const _Alloc1 &)
- void _M_destroy_data_aux (iterator __first, iterator __last)
- void _M_destroy_data_dispatch (iterator __first, iterator __last, __false_type)
- void _M_destroy_data_dispatch (iterator, iterator, __true_type)
- void _M_destroy_nodes (_Tp **__nstart, _Tp **__nfinish)
- void _M_detach_all ()
- void _M_detach_singular ()
- void _M_erase_at_begin (iterator __pos)
- void _M_erase_at_end (iterator __pos)
- void _M_fill_assign (size_type __n, const value_type &__val)
- void _M_fill_initialize (const value_type &__value)
- void _M_fill_insert (iterator __pos, size_type __n, const value_type &__x)
- _Map_alloc_type _M_get_map_allocator () const
- __gnu_cxx::__mutex & _M_get_mutex ()
- const _Tp_alloc_type & _M_get_Tp_allocator () const
- _Tp_alloc_type & _M_get_Tp_allocator ()
- void _M_initialize_dispatch (_InputIterator __first, _InputIterator __last, __false_type)
- void _M_initialize_dispatch (_Integer __n, _Integer __x, __true_type)
- void _M_initialize_map (size_t)
- void _M_insert_aux (iterator __pos, _ForwardIterator __first, _ForwardIterator __last, size_type __n)
- void _M_insert_aux (iterator __pos, size_type __n, const value_type &__x)
- iterator _M_insert_aux (iterator __pos, const value_type &__x)
- void _M_insert_dispatch (iterator __pos, _InputIterator __first, _InputIterator __last, __false_type)
- void _M_insert_dispatch (iterator __pos, _Integer __n, _Integer __x, __true_type)
- void _M_new_elements_at_back (size_type __new_elements)
- void _M_new_elements_at_front (size_type __new_elements)
- void _M_pop_back_aux ()
- void _M_pop_front_aux ()
- void _M_push_back_aux (const value_type &)
- void _M_push_front_aux (const value_type &)
- void _M_range_check (size_type __n) const
- void _M_range_initialize (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
- void _M_range_initialize (_InputIterator __first, _InputIterator __last, std::input_iterator_tag)
- void _M_range_insert_aux (iterator __pos, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
- void _M_range_insert_aux (iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag)
- void _M_reallocate_map (size_type __nodes_to_add, bool __add_at_front)
- iterator _M_reserve_elements_at_back (size_type __n)
- iterator _M_reserve_elements_at_front (size_type __n)
- void _M_reserve_map_at_back (size_type __nodes_to_add=1)
- void _M_reserve_map_at_front (size_type __nodes_to_add=1)
- void _M_revalidate_singular ()
- void _M_swap (_Safe_sequence_base &__x)

## Static Protected Member Functions

- static size_t _S_buffer_size ()

## Protected Attributes

- _Deque_impl _M_impl

## Constructor & Destructor Documentation

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

std::__debug::deque< _Tp, _Allocator >::deque | ( | const _Allocator & | __a = `_Allocator()` | ) | `[inline, explicit]`

Default constructor creates no elements.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 74 of file debug/deque.

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

std::__debug::deque< _Tp, _Allocator >::deque | ( | size_type | __n,
|  | const _Tp & | __value = `_Tp()`,
|  | const _Allocator & | __a = `_Allocator()` |
| ) |  |  | `[inline, explicit]`

Create a deque with copies of an exemplar element.

Parameters:

  | n | The number of elements to initially create.
  | value | An element to copy.

This constructor fills the deque with n copies of value.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 77 of file debug/deque.

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>
template<class _InputIterator>

std::__debug::deque< _Tp, _Allocator >::deque | ( | _InputIterator | __first,
|  | _InputIterator | __last,
|  | const _Allocator & | __a = `_Allocator()` |
| ) |  |  | `[inline]`

Builds a deque from a range.

Parameters:

  | first | An input iterator.
  | last | An input iterator.

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.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 82 of file debug/deque.

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

std::__debug::deque< _Tp, _Allocator >::~deque | ( |  | ) | `[inline]`

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 responsibilty.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 91 of file debug/deque.

## Member Function Documentation

void __gnu_debug::_Safe_sequence_base::_M_detach_all | ( |  | ) | `[protected, inherited]`

Detach all iterators, leaving them singular.

Referenced by __gnu_debug::_Safe_sequence_base::~_Safe_sequence_base().

void __gnu_debug::_Safe_sequence_base::_M_detach_singular | ( |  | ) | `[protected, inherited]`

Detach all singular iterators.

Postcondition:
  for all iterators i attached to this sequence, i->_M_version == _M_version.

Referenced by std::__debug::deque< _Tp, _Allocator >::erase(), and std::__debug::list< _Tp, _Allocator >::resize().

__gnu_cxx::__mutex& __gnu_debug::_Safe_sequence_base::_M_get_mutex | ( |  | ) | `[protected, inherited]`

For use in _Safe_sequence.

void __gnu_debug::_Safe_sequence_base::_M_invalidate_all | ( |  | ) | const`[inline, inherited]`

Invalidates all iterators.

Definition at line 220 of file safe_base.h.

References __gnu_debug::_Safe_sequence_base::_M_version.

Referenced by __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::append(), std::__debug::vector< _Tp, _Allocator >::assign(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::assign(), std::__debug::deque< _Tp, _Allocator >::assign(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::c_str(), std::__debug::vector< _Tp, _Allocator >::clear(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::clear(), std::__debug::deque< _Tp, _Allocator >::clear(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::data(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::erase(), std::__debug::deque< _Tp, _Allocator >::erase(), __gnu_debug::getline(), std::__debug::vector< _Tp, _Allocator >::insert(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::insert(), std::__debug::deque< _Tp, _Allocator >::insert(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::operator+=(), std::__debug::vector< _Tp, _Allocator >::operator=(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::operator=(), std::__debug::deque< _Tp, _Allocator >::operator=(), __gnu_debug::operator>>(), std::__debug::vector< _Tp, _Allocator >::push_back(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::push_back(), std::__debug::deque< _Tp, _Allocator >::push_back(), std::__debug::deque< _Tp, _Allocator >::push_front(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::replace(), std::__debug::vector< _Tp, _Allocator >::reserve(), std::__debug::vector< _Tp, _Allocator >::resize(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::resize(), std::__debug::deque< _Tp, _Allocator >::resize(), and __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::swap().

template<typename _Sequence>
template<typename _Predicate>

void __gnu_debug::_Safe_sequence< _Sequence >::_M_invalidate_if | ( | _Predicate | __pred | ) | `[inherited]`

Invalidates all iterators `x` that reference this sequence, are not singular, and for which `pred(x)` returns `true`. The user of this routine should be careful not to make copies of the iterators passed to `pred`, as the copies may interfere with the invalidation.

Definition at line 126 of file safe_sequence.h.

References __gnu_debug::_Safe_sequence_base::_M_const_iterators, and __gnu_debug::_Safe_sequence_base::_M_iterators.

Referenced by std::__debug::vector< _Tp, _Allocator >::erase(), std::__debug::vector< _Tp, _Allocator >::insert(), std::__debug::vector< _Tp, _Allocator >::resize(), and std::__debug::deque< _Tp, _Allocator >::resize().

void __gnu_debug::_Safe_sequence_base::_M_revalidate_singular | ( |  | ) | `[protected, inherited]`

Revalidates all attached singular iterators. This method may be used to validate iterators that were invalidated before (but for some reasion, such as an exception, need to become valid again).

Referenced by std::__debug::deque< _Tp, _Allocator >::erase(), and std::__debug::list< _Tp, _Allocator >::resize().

void __gnu_debug::_Safe_sequence_base::_M_swap | ( | _Safe_sequence_base & | __x | ) | `[protected, inherited]`

Swap this sequence with the given sequence. This operation also swaps ownership of the iterators, so that when the operation is complete all iterators that originally referenced one container now reference the other container.

Referenced by std::__debug::vector< _Tp, _Allocator >::swap(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::swap(), std::__debug::set< _Key, _Compare, _Allocator >::swap(), std::__debug::multiset< _Key, _Compare, _Allocator >::swap(), std::__debug::multimap< _Key, _Tp, _Compare, _Allocator >::swap(), std::__debug::map< _Key, _Tp, _Compare, _Allocator >::swap(), std::__debug::list< _Tp, _Allocator >::swap(), __gnu_cxx::__debug::hash_set< _Value, _HashFcn, _EqualKey, _Alloc >::swap(), __gnu_cxx::__debug::hash_multiset< _Value, _HashFcn, _EqualKey, _Alloc >::swap(), __gnu_cxx::__debug::hash_multimap< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::swap(), __gnu_cxx::__debug::hash_map< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::swap(), and std::__debug::deque< _Tp, _Allocator >::swap().

template<typename _Sequence>
template<typename _Iterator>

void __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_iter | ( | const _Safe_iterator< _Iterator, _Sequence > & | __x | ) | `[inherited]`

Transfers all iterators that reference this memory location to this sequence from whatever sequence they are attached to.

Definition at line 159 of file safe_sequence.h.

References __gnu_debug::_Safe_sequence_base::_M_const_iterators, __gnu_debug::_Safe_sequence_base::_M_iterators, __gnu_debug::_Safe_iterator_base::_M_sequence, and __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::base().

Referenced by std::__debug::list< _Tp, _Allocator >::splice().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

void std::__debug::deque< _Tp, _Allocator >::assign | ( | size_type | __n,
|  | const _Tp & | __t |
| ) |  |  | `[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. Old data may be lost.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 111 of file debug/deque.

References __gnu_debug::_Safe_sequence_base::_M_invalidate_all(), and std::deque< _Tp, _Allocator >::assign().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>
template<class _InputIterator>

void std::__debug::deque< _Tp, _Allocator >::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. Old data may be lost.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 103 of file debug/deque.

References __glibcxx_check_valid_range, __gnu_debug::_Safe_sequence_base::_M_invalidate_all(), and std::deque< _Tp, _Allocator >::assign().

const_reference std::deque< _Tp , _Allocator >::at | ( | size_type | __n | ) | const`[inline, inherited]`

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.

Exceptions:

  | 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 975 of file stl_deque.h.

References std::deque< _Tp, _Alloc >::_M_range_check().

reference std::deque< _Tp , _Allocator >::at | ( | size_type | __n | ) | `[inline, inherited]`

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.

Exceptions:

  | 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 957 of file stl_deque.h.

References std::deque< _Tp, _Alloc >::_M_range_check().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

const_reference std::__debug::deque< _Tp, _Allocator >::back | ( |  | ) | const`[inline]`

Returns a read-only (constant) reference to the data at the last element of the deque.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 213 of file debug/deque.

References __glibcxx_check_nonempty, and std::deque< _Tp, _Allocator >::back().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

reference std::__debug::deque< _Tp, _Allocator >::back | ( |  | ) | `[inline]`

Returns a read/write reference to the data at the last element of the deque.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 206 of file debug/deque.

References __glibcxx_check_nonempty, and std::deque< _Tp, _Allocator >::back().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

const_iterator std::__debug::deque< _Tp, _Allocator >::begin | ( |  | ) | const`[inline]`

Returns a read-only (constant) iterator that points to the first element in the deque. Iteration is done in ordinary element order.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 125 of file debug/deque.

References std::deque< _Tp, _Allocator >::begin().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

iterator std::__debug::deque< _Tp, _Allocator >::begin | ( |  | ) | `[inline]`

Returns a read/write iterator that points to the first element in the deque. Iteration is done in ordinary element order.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 121 of file debug/deque.

References std::deque< _Tp, _Allocator >::begin().

Referenced by std::__debug::deque< _Tp, _Allocator >::erase(), std::__debug::deque< _Tp, _Allocator >::pop_front(), std::__debug::deque< _Tp, _Allocator >::rend(), and std::__debug::deque< _Tp, _Allocator >::resize().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

void std::__debug::deque< _Tp, _Allocator >::clear | ( |  | ) | `[inline]`

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 responsibilty.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 339 of file debug/deque.

References __gnu_debug::_Safe_sequence_base::_M_invalidate_all(), and std::deque< _Tp, _Allocator >::clear().

bool std::deque< _Tp , _Allocator >::empty | ( |  | ) | const`[inline, inherited]`

Returns true if the deque is empty. (Thus begin() would equal end().)

Definition at line 901 of file stl_deque.h.

References std::_Deque_base< _Tp, _Alloc >::_M_impl.

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

const_iterator std::__debug::deque< _Tp, _Allocator >::end | ( |  | ) | const`[inline]`

Returns a read-only (constant) iterator that points one past the last element in the deque. Iteration is done in ordinary element order.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 133 of file debug/deque.

References std::deque< _Tp, _Allocator >::end().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

iterator std::__debug::deque< _Tp, _Allocator >::end | ( |  | ) | `[inline]`

Returns a read/write iterator that points one past the last element in the deque. Iteration is done in ordinary element order.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 129 of file debug/deque.

References std::deque< _Tp, _Allocator >::end().

Referenced by std::__debug::deque< _Tp, _Allocator >::erase(), std::__debug::deque< _Tp, _Allocator >::pop_back(), and std::__debug::deque< _Tp, _Allocator >::rbegin().

iterator std::deque< _Tp , _Allocator >::erase | ( | iterator | __first,
|  | iterator | __last |
| ) |  |  | `[inherited]`

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 responsibilty.

iterator std::deque< _Tp , _Allocator >::erase | ( | iterator | __position | ) | `[inherited]`

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 responsibilty.

Referenced by std::__debug::deque< _Tp, _Allocator >::erase().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

const_reference std::__debug::deque< _Tp, _Allocator >::front | ( |  | ) | const`[inline]`

Returns a read-only (constant) reference to the data at the first element of the deque.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 199 of file debug/deque.

References __glibcxx_check_nonempty, and std::deque< _Tp, _Allocator >::front().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

reference std::__debug::deque< _Tp, _Allocator >::front | ( |  | ) | `[inline]`

Returns a read/write reference to the data at the first element of the deque.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 192 of file debug/deque.

References __glibcxx_check_nonempty, and std::deque< _Tp, _Allocator >::front().

allocator_type std::deque< _Tp , _Allocator >::get_allocator | ( |  | ) | const`[inline, inherited]`

Get a copy of the memory allocation object.

Reimplemented from std::_Deque_base< _Tp, _Allocator >.

Definition at line 790 of file stl_deque.h.

References std::_Deque_base< _Tp, _Alloc >::get_allocator().

void std::deque< _Tp , _Allocator >::insert | ( | iterator | __position,
|  | _InputIterator | __first,
|  | _InputIterator | __last |
| ) |  |  | `[inline, inherited]`

Inserts a range into the deque.

Parameters:

  | position | An 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 pos. This is known as "range insert."

Definition at line 1144 of file stl_deque.h.

References std::deque< _Tp, _Alloc >::_M_insert_dispatch().

void std::deque< _Tp , _Allocator >::insert | ( | iterator | __position,
|  | size_type | __n,
|  | const value_type & | __x |
| ) |  |  | `[inline, inherited]`

Inserts a number of copies of given data into the deque.

Parameters:

  | position | An 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 1129 of file stl_deque.h.

References std::deque< _Tp, _Alloc >::_M_fill_insert().

iterator std::deque< _Tp , _Allocator >::insert | ( | iterator | __position,
|  | const value_type & | __x |
| ) |  |  | `[inherited]`

Inserts given value into deque before specified iterator.

Parameters:

  | position | An 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.

Referenced by std::__debug::deque< _Tp, _Allocator >::insert().

size_type std::deque< _Tp , _Allocator >::max_size | ( |  | ) | const`[inline, inherited]`

Returns the size() of the largest possible deque.

Definition at line 872 of file stl_deque.h.

References std::_Deque_base< _Tp, _Alloc >::_M_get_Tp_allocator().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

const_reference std::__debug::deque< _Tp, _Allocator >::operator[] | ( | size_type | __n | ) | const`[inline]`

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().)

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 183 of file debug/deque.

References __glibcxx_check_subscript, and std::__debug::deque< _Tp, _Allocator >::_M_base().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

reference std::__debug::deque< _Tp, _Allocator >::operator[] | ( | size_type | __n | ) | `[inline]`

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().)

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 176 of file debug/deque.

References __glibcxx_check_subscript, and std::__debug::deque< _Tp, _Allocator >::_M_base().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

void std::__debug::deque< _Tp, _Allocator >::pop_back | ( |  | ) | `[inline]`

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.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 271 of file debug/deque.

References __glibcxx_check_nonempty, __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_invalidate(), std::__debug::deque< _Tp, _Allocator >::end(), and std::deque< _Tp, _Allocator >::pop_back().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

void std::__debug::deque< _Tp, _Allocator >::pop_front | ( |  | ) | `[inline]`

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.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 262 of file debug/deque.

References __glibcxx_check_nonempty, __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_invalidate(), std::__debug::deque< _Tp, _Allocator >::begin(), and std::deque< _Tp, _Allocator >::pop_front().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

void std::__debug::deque< _Tp, _Allocator >::push_back | ( | const _Tp & | __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.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 228 of file debug/deque.

References __gnu_debug::_Safe_sequence_base::_M_invalidate_all(), and std::deque< _Tp, _Allocator >::push_back().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

void std::__debug::deque< _Tp, _Allocator >::push_front | ( | const _Tp & | __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.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 221 of file debug/deque.

References __gnu_debug::_Safe_sequence_base::_M_invalidate_all(), and std::deque< _Tp, _Allocator >::push_front().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

const_reverse_iterator std::__debug::deque< _Tp, _Allocator >::rbegin | ( |  | ) | const`[inline]`

Returns a read-only (constant) reverse iterator that points to the last element in the deque. Iteration is done in reverse element order.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 141 of file debug/deque.

References std::__debug::deque< _Tp, _Allocator >::end().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

reverse_iterator std::__debug::deque< _Tp, _Allocator >::rbegin | ( |  | ) | `[inline]`

Returns a read/write reverse iterator that points to the last element in the deque. Iteration is done in reverse element order.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 137 of file debug/deque.

References std::__debug::deque< _Tp, _Allocator >::end().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

const_reverse_iterator std::__debug::deque< _Tp, _Allocator >::rend | ( |  | ) | const`[inline]`

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.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 149 of file debug/deque.

References std::__debug::deque< _Tp, _Allocator >::begin().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

reverse_iterator std::__debug::deque< _Tp, _Allocator >::rend | ( |  | ) | `[inline]`

Returns a read/write reverse iterator that points to one before the first element in the deque. Iteration is done in reverse element order.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 145 of file debug/deque.

References std::__debug::deque< _Tp, _Allocator >::begin().

template<typename _Tp, typename _Allocator = std::allocator<_Tp>>

void std::__debug::deque< _Tp, _Allocator >::resize | ( | size_type | __sz,
|  | _Tp | __c = `_Tp()` |
| ) |  |  | `[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.

Reimplemented from std::deque< _Tp, _Allocator >.

Definition at line 157 of file debug/deque.

References std::__debug::deque< _Tp, _Allocator >::_M_base(), __gnu_debug::_Safe_sequence_base::_M_invalidate_all(), __gnu_debug::_Safe_sequence< _Sequence >::_M_invalidate_if(), std::__debug::deque< _Tp, _Allocator >::begin(), std::deque< _Tp, _Allocator >::resize(), and std::deque< _Tp, _Allocator >::size().

size_type std::deque< _Tp , _Allocator >::size | ( |  | ) | const`[inline, inherited]`

Returns the number of elements in the deque.

Definition at line 867 of file stl_deque.h.

References std::_Deque_base< _Tp, _Alloc >::_M_impl.

Referenced by std::__debug::deque< _Tp, _Allocator >::resize().

void std::deque< _Tp , _Allocator >::swap | ( | deque< _Tp, _Allocator > & | __x | ) | `[inline, inherited]`

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.

Definition at line 1197 of file stl_deque.h.

References std::_Deque_base< _Tp, _Alloc >::_M_get_Tp_allocator(), std::_Deque_base< _Tp, _Alloc >::_M_impl, std::__alloc_swap< _Alloc, >::_S_do_it(), and std::swap().

## Member Data Documentation

_Safe_iterator_base* __gnu_debug::_Safe_sequence_base::_M_const_iterators`[inherited]`

The list of constant iterators that reference this container.

Definition at line 171 of file safe_base.h.

Referenced by __gnu_debug::_Safe_sequence< _Sequence >::_M_invalidate_if(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_invalidate_single(), and __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_iter().

_Safe_iterator_base* __gnu_debug::_Safe_sequence_base::_M_iterators`[inherited]`

The list of mutable iterators that reference this container.

Definition at line 168 of file safe_base.h.

Referenced by __gnu_debug::_Safe_sequence< _Sequence >::_M_invalidate_if(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_invalidate_single(), and __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_iter().

unsigned int __gnu_debug::_Safe_sequence_base::_M_version`[mutable, inherited]`

The container version number. This number may never be 0.

Definition at line 174 of file safe_base.h.

Referenced by __gnu_debug::_Safe_sequence_base::_M_invalidate_all().

The documentation for this class was generated from the following file:

- debug/deque