Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::container::deque< T, Allocator > Class Template Reference

#include <deque.hpp>

Inheritance diagram for boost::container::deque< T, Allocator >:
Collaboration diagram for boost::container::deque< T, Allocator >:

Public Types

typedef T value_type
 
typedef
::boost::container::allocator_traits
< Allocator >::pointer 
pointer
 
typedef
::boost::container::allocator_traits
< Allocator >::const_pointer 
const_pointer
 
typedef
::boost::container::allocator_traits
< Allocator >::reference 
reference
 
typedef
::boost::container::allocator_traits
< Allocator >::const_reference 
const_reference
 
typedef
::boost::container::allocator_traits
< Allocator >::size_type 
size_type
 
typedef
::boost::container::allocator_traits
< Allocator >::difference_type 
difference_type
 
typedef Allocator allocator_type
 

Public Member Functions

typedef BOOST_CONTAINER_IMPDEF (allocator_type) stored_allocator_type
 
typedef BOOST_CONTAINER_IMPDEF (typename Base::iterator) iterator
 
typedef BOOST_CONTAINER_IMPDEF (typename Base::const_iterator) const _iterator
 
typedef BOOST_CONTAINER_IMPDEF (container_detail::reverse_iterator< iterator >) reverse_iterator
 
typedef BOOST_CONTAINER_IMPDEF (container_detail::reverse_iterator< const_iterator >) const _reverse_iterator
 
 deque ()
 Effects: Default constructors a deque. More...
 
 deque (const allocator_type &a) BOOST_CONTAINER_NOEXCEPT
 Effects: Constructs a deque taking the allocator as parameter. More...
 
 deque (size_type n)
 Effects: Constructs a deque that will use a copy of allocator a and inserts n value initialized values. More...
 
 deque (size_type n, default_init_t)
 Effects: Constructs a deque that will use a copy of allocator a and inserts n default initialized values. More...
 
 deque (size_type n, const value_type &value, const allocator_type &a=allocator_type())
 Effects: Constructs a deque that will use a copy of allocator a and inserts n copies of value. More...
 
template<class InIt >
 deque (InIt first, InIt last, const allocator_type &a=allocator_type(), typename container_detail::enable_if_c< !container_detail::is_convertible< InIt, size_type >::value >::type *=0)
 Effects: Constructs a deque that will use a copy of allocator a and inserts a copy of the range [first, last) in the deque. More...
 
 deque (std::initializer_list< value_type > il, const allocator_type &a=allocator_type())
 Effects: Constructs a deque that will use a copy of allocator a and inserts a copy of the range [il.begin(), il.end()) in the deque. More...
 
 deque (const deque &x)
 Effects: Copy constructs a deque. More...
 
 deque (BOOST_RV_REF(deque) x)
 Effects: Move constructor. More...
 
 deque (const deque &x, const allocator_type &a)
 Effects: Copy constructs a vector using the specified allocator. More...
 
 deque (BOOST_RV_REF(deque) mx, const allocator_type &a)
 Effects: Move constructor using the specified allocator. More...
 
 ~deque () BOOST_CONTAINER_NOEXCEPT
 Effects: Destroys the deque. More...
 
dequeoperator= (BOOST_COPY_ASSIGN_REF(deque) x)
 Effects: Makes *this contain the same elements as x. More...
 
dequeoperator= (BOOST_RV_REF(deque) x) BOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type
 Effects: Move assignment. More...
 
dequeoperator= (std::initializer_list< value_type > il)
 Effects: Makes *this contain the same elements as il. More...
 
void assign (size_type n, const T &val)
 Effects: Assigns the n copies of val to *this. More...
 
template<class InIt >
void assign (InIt first, InIt last, typename container_detail::enable_if_c< !container_detail::is_convertible< InIt, size_type >::value &&container_detail::is_input_iterator< InIt >::value >::type *=0)
 Effects: Assigns the the range [first, last) to *this. More...
 
template<class FwdIt >
void assign (FwdIt first, FwdIt last, typename container_detail::enable_if_c< !container_detail::is_convertible< FwdIt, size_type >::value &&!container_detail::is_input_iterator< FwdIt >::value >::type *=0)
 
void assign (std::initializer_list< value_type > il)
 Effects: Assigns the the range [il.begin(), il.end()) to *this. More...
 
allocator_type get_allocator () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a copy of the internal allocator. More...
 
const stored_allocator_typeget_stored_allocator () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reference to the internal allocator. More...
 
stored_allocator_typeget_stored_allocator () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reference to the internal allocator. More...
 
iterator begin () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns an iterator to the first element contained in the deque. More...
 
const_iterator begin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the first element contained in the deque. More...
 
iterator end () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns an iterator to the end of the deque. More...
 
const_iterator end () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the end of the deque. More...
 
reverse_iterator rbegin () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reverse_iterator pointing to the beginning of the reversed deque. More...
 
const_reverse_iterator rbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed deque. More...
 
reverse_iterator rend () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reverse_iterator pointing to the end of the reversed deque. More...
 
const_reverse_iterator rend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the end of the reversed deque. More...
 
const_iterator cbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the first element contained in the deque. More...
 
const_iterator cend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the end of the deque. More...
 
const_reverse_iterator crbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed deque. More...
 
const_reverse_iterator crend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the end of the reversed deque. More...
 
bool empty () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns true if the deque contains no elements. More...
 
size_type size () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns the number of the elements contained in the deque. More...
 
size_type max_size () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns the largest possible size of the deque. More...
 
void resize (size_type new_size)
 Effects: Inserts or erases elements at the end such that the size becomes n. More...
 
void resize (size_type new_size, default_init_t)
 Effects: Inserts or erases elements at the end such that the size becomes n. More...
 
void resize (size_type new_size, const value_type &x)
 Effects: Inserts or erases elements at the end such that the size becomes n. More...
 
void shrink_to_fit ()
 Effects: Tries to deallocate the excess of memory created with previous allocations. More...
 
reference front () BOOST_CONTAINER_NOEXCEPT
 Requires: !empty() More...
 
const_reference front () const BOOST_CONTAINER_NOEXCEPT
 Requires: !empty() More...
 
reference back () BOOST_CONTAINER_NOEXCEPT
 Requires: !empty() More...
 
const_reference back () const BOOST_CONTAINER_NOEXCEPT
 Requires: !empty() More...
 
reference operator[] (size_type n) BOOST_CONTAINER_NOEXCEPT
 Requires: size() > n. More...
 
const_reference operator[] (size_type n) const BOOST_CONTAINER_NOEXCEPT
 Requires: size() > n. More...
 
reference at (size_type n)
 Requires: size() > n. More...
 
const_reference at (size_type n) const
 Requires: size() > n. More...
 
iterator insert (const_iterator pos, size_type n, const value_type &x)
 Requires: pos must be a valid iterator of *this. More...
 
template<class InIt >
iterator insert (const_iterator pos, InIt first, InIt last, typename container_detail::enable_if_c< !container_detail::is_convertible< InIt, size_type >::value &&container_detail::is_input_iterator< InIt >::value >::type *=0)
 Requires: pos must be a valid iterator of *this. More...
 
iterator insert (const_iterator pos, std::initializer_list< value_type > il)
 Requires: pos must be a valid iterator of *this. More...
 
template<class FwdIt >
iterator insert (const_iterator p, FwdIt first, FwdIt last, typename container_detail::enable_if_c< !container_detail::is_convertible< FwdIt, size_type >::value &&!container_detail::is_input_iterator< FwdIt >::value >::type *=0)
 
void pop_front () BOOST_CONTAINER_NOEXCEPT
 Effects: Removes the first element from the deque. More...
 
void pop_back () BOOST_CONTAINER_NOEXCEPT
 Effects: Removes the last element from the deque. More...
 
iterator erase (const_iterator pos) BOOST_CONTAINER_NOEXCEPT
 Effects: Erases the element at p. More...
 
iterator erase (const_iterator first, const_iterator last) BOOST_CONTAINER_NOEXCEPT
 Effects: Erases the elements pointed by [first, last). More...
 
void swap (deque &x)
 Effects: Swaps the contents of *this and x. More...
 
void clear () BOOST_CONTAINER_NOEXCEPT
 Effects: Erases all the elements of the deque. More...
 

Protected Types

enum  { InitialMapSize = 8 }
 
typedef allocator_traits
< Allocator > 
val_alloc_traits_type
 
typedef
val_alloc_traits_type::value_type 
val_alloc_val
 
typedef
val_alloc_traits_type::pointer 
val_alloc_ptr
 
typedef
val_alloc_traits_type::const_pointer 
val_alloc_cptr
 
typedef
val_alloc_traits_type::reference 
val_alloc_ref
 
typedef
val_alloc_traits_type::const_reference 
val_alloc_cref
 
typedef
val_alloc_traits_type::difference_type 
val_alloc_diff
 
typedef
val_alloc_traits_type::size_type 
val_alloc_size
 
typedef
val_alloc_traits_type::template
portable_rebind_alloc
< val_alloc_ptr >::type 
ptr_alloc_t
 
typedef allocator_traits
< ptr_alloc_t
ptr_alloc_traits_type
 
typedef
ptr_alloc_traits_type::value_type 
ptr_alloc_val
 
typedef
ptr_alloc_traits_type::pointer 
ptr_alloc_ptr
 
typedef
ptr_alloc_traits_type::const_pointer 
ptr_alloc_cptr
 
typedef
ptr_alloc_traits_type::reference 
ptr_alloc_ref
 
typedef
ptr_alloc_traits_type::const_reference 
ptr_alloc_cref
 
typedef allocator_type stored_allocator_type
 
typedef deque_value_traits
< val_alloc_val
traits_t
 
typedef ptr_alloc_t map_allocator_type
 
typedef
container_detail::deque_iterator
< val_alloc_ptr, false > 
iterator
 
typedef
container_detail::deque_iterator
< val_alloc_ptr, true > 
const_iterator
 

Protected Member Functions

val_alloc_ptr priv_allocate_node ()
 
void priv_deallocate_node (val_alloc_ptr p) BOOST_CONTAINER_NOEXCEPT
 
ptr_alloc_ptr priv_allocate_map (size_type n)
 
void priv_deallocate_map (ptr_alloc_ptr p, size_type n) BOOST_CONTAINER_NOEXCEPT
 
void swap_members (deque_base &x) BOOST_CONTAINER_NOEXCEPT
 
void priv_initialize_map (size_type num_elements)
 
void priv_create_nodes (ptr_alloc_ptr nstart, ptr_alloc_ptr nfinish)
 
void priv_destroy_nodes (ptr_alloc_ptr nstart, ptr_alloc_ptr nfinish) BOOST_CONTAINER_NOEXCEPT
 
void priv_clear_map () BOOST_CONTAINER_NOEXCEPT
 
ptr_alloc_tptr_alloc () BOOST_CONTAINER_NOEXCEPT
 
const ptr_alloc_tptr_alloc () const BOOST_CONTAINER_NOEXCEPT
 
allocator_typealloc () BOOST_CONTAINER_NOEXCEPT
 
const allocator_typealloc () const BOOST_CONTAINER_NOEXCEPT
 

Protected Attributes

boost::container::deque_base::members_holder members_
 

Friends

bool operator== (const deque &x, const deque &y)
 Effects: Returns true if x and y are equal More...
 
bool operator!= (const deque &x, const deque &y)
 Effects: Returns true if x and y are unequal More...
 
bool operator< (const deque &x, const deque &y)
 Effects: Returns true if x is less than y More...
 
bool operator> (const deque &x, const deque &y)
 Effects: Returns true if x is greater than y More...
 
bool operator<= (const deque &x, const deque &y)
 Effects: Returns true if x is equal or less than y More...
 
bool operator>= (const deque &x, const deque &y)
 Effects: Returns true if x is equal or greater than y More...
 
void swap (deque &x, deque &y)
 Effects: x.swap(y) More...
 

Member Typedef Documentation

template<class T , class Allocator >
typedef Allocator boost::container::deque< T, Allocator >::allocator_type
template<class Allocator >
typedef container_detail::deque_iterator<val_alloc_ptr, true > boost::container::deque_base< Allocator >::const_iterator
protectedinherited
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::const_pointer boost::container::deque< T, Allocator >::const_pointer
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::const_reference boost::container::deque< T, Allocator >::const_reference
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::difference_type boost::container::deque< T, Allocator >::difference_type
template<class Allocator >
typedef container_detail::deque_iterator<val_alloc_ptr, false> boost::container::deque_base< Allocator >::iterator
protectedinherited
template<class Allocator >
typedef ptr_alloc_t boost::container::deque_base< Allocator >::map_allocator_type
protectedinherited
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::pointer boost::container::deque< T, Allocator >::pointer
template<class Allocator >
typedef ptr_alloc_traits_type::const_pointer boost::container::deque_base< Allocator >::ptr_alloc_cptr
inherited
template<class Allocator >
typedef ptr_alloc_traits_type::const_reference boost::container::deque_base< Allocator >::ptr_alloc_cref
inherited
template<class Allocator >
typedef ptr_alloc_traits_type::pointer boost::container::deque_base< Allocator >::ptr_alloc_ptr
inherited
template<class Allocator >
typedef ptr_alloc_traits_type::reference boost::container::deque_base< Allocator >::ptr_alloc_ref
inherited
template<class Allocator >
typedef val_alloc_traits_type::template portable_rebind_alloc<val_alloc_ptr>::type boost::container::deque_base< Allocator >::ptr_alloc_t
inherited
template<class Allocator >
typedef allocator_traits<ptr_alloc_t> boost::container::deque_base< Allocator >::ptr_alloc_traits_type
inherited
template<class Allocator >
typedef ptr_alloc_traits_type::value_type boost::container::deque_base< Allocator >::ptr_alloc_val
inherited
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::reference boost::container::deque< T, Allocator >::reference
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::size_type boost::container::deque< T, Allocator >::size_type
template<class Allocator >
typedef allocator_type boost::container::deque_base< Allocator >::stored_allocator_type
inherited
template<class Allocator >
typedef deque_value_traits<val_alloc_val> boost::container::deque_base< Allocator >::traits_t
protectedinherited
template<class Allocator >
typedef val_alloc_traits_type::const_pointer boost::container::deque_base< Allocator >::val_alloc_cptr
inherited
template<class Allocator >
typedef val_alloc_traits_type::const_reference boost::container::deque_base< Allocator >::val_alloc_cref
inherited
template<class Allocator >
typedef val_alloc_traits_type::difference_type boost::container::deque_base< Allocator >::val_alloc_diff
inherited
template<class Allocator >
typedef val_alloc_traits_type::pointer boost::container::deque_base< Allocator >::val_alloc_ptr
inherited
template<class Allocator >
typedef val_alloc_traits_type::reference boost::container::deque_base< Allocator >::val_alloc_ref
inherited
template<class Allocator >
typedef val_alloc_traits_type::size_type boost::container::deque_base< Allocator >::val_alloc_size
inherited
template<class Allocator >
typedef allocator_traits<Allocator> boost::container::deque_base< Allocator >::val_alloc_traits_type
inherited
template<class Allocator >
typedef val_alloc_traits_type::value_type boost::container::deque_base< Allocator >::val_alloc_val
inherited
template<class T , class Allocator >
typedef T boost::container::deque< T, Allocator >::value_type

Member Enumeration Documentation

template<class Allocator >
anonymous enum
protectedinherited
Enumerator
InitialMapSize 

Constructor & Destructor Documentation

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( )
inline

Effects: Default constructors a deque.

Throws: If allocator_type's default constructor throws.

Complexity: Constant.

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( const allocator_type a)
inlineexplicit

Effects: Constructs a deque taking the allocator as parameter.

Throws: Nothing

Complexity: Constant.

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( size_type  n)
inlineexplicit

Effects: Constructs a deque that will use a copy of allocator a and inserts n value initialized values.

Throws: If allocator_type's default constructor throws or T's value initialization throws.

Complexity: Linear to n.

References boost::container::deque_base< Allocator >::alloc(), and boost::container::deque< T, Allocator >::begin().

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( size_type  n,
default_init_t   
)
inline

Effects: Constructs a deque that will use a copy of allocator a and inserts n default initialized values.

Throws: If allocator_type's default constructor throws or T's default initialization or copy constructor throws.

Complexity: Linear to n.

Note: Non-standard extension

References boost::container::deque_base< Allocator >::alloc(), and boost::container::deque< T, Allocator >::begin().

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( size_type  n,
const value_type value,
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs a deque that will use a copy of allocator a and inserts n copies of value.

Throws: If allocator_type's default constructor throws or T's copy constructor throws.

Complexity: Linear to n.

template<class T , class Allocator >
template<class InIt >
boost::container::deque< T, Allocator >::deque ( InIt  first,
InIt  last,
const allocator_type a = allocator_type(),
typename container_detail::enable_if_c< !container_detail::is_convertible< InIt, size_type >::value >::type = 0 
)
inline

Effects: Constructs a deque that will use a copy of allocator a and inserts a copy of the range [first, last) in the deque.

Throws: If allocator_type's default constructor throws or T's constructor taking a dereferenced InIt throws.

Complexity: Linear to the range [first, last).

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( std::initializer_list< value_type il,
const allocator_type a = allocator_type() 
)
inline

Effects: Constructs a deque that will use a copy of allocator a and inserts a copy of the range [il.begin(), il.end()) in the deque.

Throws: If allocator_type's default constructor throws or T's constructor taking a dereferenced std::initializer_list iterator throws.

Complexity: Linear to the range [il.begin(), il.end()).

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( const deque< T, Allocator > &  x)
inline
template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( BOOST_RV_REF(deque< T, Allocator >)  x)
inline

Effects: Move constructor.

Moves mx's resources to *this.

Throws: If allocator_type's copy constructor throws.

Complexity: Constant.

References boost::container::deque_base< Allocator >::swap_members().

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( const deque< T, Allocator > &  x,
const allocator_type a 
)
inline

Effects: Copy constructs a vector using the specified allocator.

Postcondition: x == *this.

Throws: If allocation throws or T's copy constructor throws.

Complexity: Linear to the elements x contains.

References boost::container::deque_base< Allocator >::alloc(), boost::container::deque_base< Allocator >::members_holder::m_start, boost::container::deque_base< Allocator >::members_, and boost::container::deque_base< Allocator >::priv_initialize_map().

template<class T , class Allocator >
boost::container::deque< T, Allocator >::deque ( BOOST_RV_REF(deque< T, Allocator >)  mx,
const allocator_type a 
)
inline

Effects: Move constructor using the specified allocator.

Moves mx's resources to *this if a == allocator_type(). Otherwise copies values from x to *this.

Throws: If allocation or T's copy constructor throws.

Complexity: Constant if a == mx.get_allocator(), linear otherwise.

References boost::a, boost::container::deque_base< Allocator >::alloc(), boost::container::deque_base< Allocator >::members_holder::m_start, boost::container::deque_base< Allocator >::members_, boost::container::deque_base< Allocator >::priv_initialize_map(), and boost::container::deque_base< Allocator >::swap_members().

template<class T , class Allocator >
boost::container::deque< T, Allocator >::~deque ( )
inline

Effects: Destroys the deque.

All stored values are destroyed and used memory is deallocated.

Throws: Nothing.

Complexity: Linear to the number of elements.

References boost::container::deque_base< Allocator >::members_holder::m_start, boost::container::deque_base< Allocator >::members_, and boost::multiprecision::backends::this.

Member Function Documentation

template<class Allocator >
const allocator_type& boost::container::deque_base< Allocator >::alloc ( ) const
inlineprotectedinherited
template<class T , class Allocator >
void boost::container::deque< T, Allocator >::assign ( size_type  n,
const T val 
)
inline

Effects: Assigns the n copies of val to *this.

Throws: If memory allocation throws or T's copy constructor throws.

Complexity: Linear to n.

Referenced by boost::container::deque< T, Allocator >::operator=().

template<class T , class Allocator >
template<class InIt >
void boost::container::deque< T, Allocator >::assign ( InIt  first,
InIt  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< InIt, size_type >::value &&container_detail::is_input_iterator< InIt >::value >::type = 0 
)
inline

Effects: Assigns the the range [first, last) to *this.

Throws: If memory allocation throws or T's constructor from dereferencing InIt throws.

Complexity: Linear to n.

References boost::container::deque< T, Allocator >::begin(), boost::container::deque< T, Allocator >::cend(), boost::container::deque< T, Allocator >::end(), boost::container::deque< T, Allocator >::erase(), boost::xpressive::first, and boost::container::deque< T, Allocator >::insert().

template<class T , class Allocator >
template<class FwdIt >
void boost::container::deque< T, Allocator >::assign ( FwdIt  first,
FwdIt  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< FwdIt, size_type >::value &&!container_detail::is_input_iterator< FwdIt >::value >::type = 0 
)
inline
template<class T , class Allocator >
void boost::container::deque< T, Allocator >::assign ( std::initializer_list< value_type il)
inline

Effects: Assigns the the range [il.begin(), il.end()) to *this.

Throws: If memory allocation throws or T's constructor from dereferencing std::initializer_list iterator throws.

Complexity: Linear to il.size().

template<class T , class Allocator >
reference boost::container::deque< T, Allocator >::at ( size_type  n)
inline

Requires: size() > n.

Effects: Returns a reference to the nth element from the beginning of the container.

Throws: std::range_error if n >= size()

Complexity: Constant.

References boost::n.

template<class T , class Allocator >
const_reference boost::container::deque< T, Allocator >::at ( size_type  n) const
inline

Requires: size() > n.

Effects: Returns a const reference to the nth element from the beginning of the container.

Throws: std::range_error if n >= size()

Complexity: Constant.

References boost::n.

template<class T , class Allocator >
reference boost::container::deque< T, Allocator >::back ( )
inline

Requires: !empty()

Effects: Returns a reference to the last element of the container.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque< T, Allocator >::end().

template<class T , class Allocator >
const_reference boost::container::deque< T, Allocator >::back ( ) const
inline

Requires: !empty()

Effects: Returns a const reference to the last element of the container.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque< T, Allocator >::cend().

template<class T , class Allocator >
iterator boost::container::deque< T, Allocator >::begin ( )
inline
template<class T , class Allocator >
const_iterator boost::container::deque< T, Allocator >::begin ( ) const
inline

Effects: Returns a const_iterator to the first element contained in the deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
typedef boost::container::deque< T, Allocator >::BOOST_CONTAINER_IMPDEF ( allocator_type  )
template<class T , class Allocator >
typedef boost::container::deque< T, Allocator >::BOOST_CONTAINER_IMPDEF ( typename Base::iterator  )
template<class T , class Allocator >
typedef boost::container::deque< T, Allocator >::BOOST_CONTAINER_IMPDEF ( typename Base::const_iterator  ) const
template<class T , class Allocator >
typedef boost::container::deque< T, Allocator >::BOOST_CONTAINER_IMPDEF ( container_detail::reverse_iterator< iterator )
template<class T , class Allocator >
typedef boost::container::deque< T, Allocator >::BOOST_CONTAINER_IMPDEF ( container_detail::reverse_iterator< const_iterator ) const
template<class T , class Allocator >
const_iterator boost::container::deque< T, Allocator >::cbegin ( ) const
inline

Effects: Returns a const_iterator to the first element contained in the deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
const_iterator boost::container::deque< T, Allocator >::cend ( ) const
inline
template<class T , class Allocator >
const_reverse_iterator boost::container::deque< T, Allocator >::crbegin ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_finish, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
const_reverse_iterator boost::container::deque< T, Allocator >::crend ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the end of the reversed deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
bool boost::container::deque< T, Allocator >::empty ( ) const
inline
template<class T , class Allocator >
iterator boost::container::deque< T, Allocator >::end ( )
inline
template<class T , class Allocator >
const_iterator boost::container::deque< T, Allocator >::end ( ) const
inline

Effects: Returns a const_iterator to the end of the deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_finish, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
reference boost::container::deque< T, Allocator >::front ( )
inline

Requires: !empty()

Effects: Returns a reference to the first element of the container.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
const_reference boost::container::deque< T, Allocator >::front ( ) const
inline

Requires: !empty()

Effects: Returns a const reference to the first element from the beginning of the container.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
allocator_type boost::container::deque< T, Allocator >::get_allocator ( ) const
inline

Effects: Returns a copy of the internal allocator.

Throws: If allocator's copy constructor throws.

Complexity: Constant.

References boost::container::deque_base< Allocator >::alloc().

template<class T , class Allocator >
const stored_allocator_type& boost::container::deque< T, Allocator >::get_stored_allocator ( ) const
inline

Effects: Returns a reference to the internal allocator.

Throws: Nothing

Complexity: Constant.

Note: Non-standard extension.

References boost::container::deque_base< Allocator >::alloc().

template<class T , class Allocator >
stored_allocator_type& boost::container::deque< T, Allocator >::get_stored_allocator ( )
inline

Effects: Returns a reference to the internal allocator.

Throws: Nothing

Complexity: Constant.

Note: Non-standard extension.

References boost::container::deque_base< Allocator >::alloc().

template<class T , class Allocator >
iterator boost::container::deque< T, Allocator >::insert ( const_iterator  pos,
size_type  n,
const value_type x 
)
inline

Requires: pos must be a valid iterator of *this.

Effects: Insert n copies of x before pos.

Returns: an iterator to the first inserted element or pos if n is 0.

Throws: If memory allocation throws or T's copy constructor throws.

Complexity: Linear to n.

Referenced by boost::container::deque< T, Allocator >::assign(), and boost::container::deque< T, Allocator >::resize().

template<class T , class Allocator >
template<class InIt >
iterator boost::container::deque< T, Allocator >::insert ( const_iterator  pos,
InIt  first,
InIt  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< InIt, size_type >::value &&container_detail::is_input_iterator< InIt >::value >::type = 0 
)
inline

Requires: pos must be a valid iterator of *this.

Effects: Insert a copy of the [first, last) range before pos.

Returns: an iterator to the first inserted element or pos if first == last.

Throws: If memory allocation throws, T's constructor from a dereferenced InIt throws or T's copy constructor throws.

Complexity: Linear to std::distance [first, last).

References boost::xpressive::first, boost::it, boost::last, boost::n, and boost::container::container_detail::deque_iterator< Pointer, IsConst >::unconst().

template<class T , class Allocator >
iterator boost::container::deque< T, Allocator >::insert ( const_iterator  pos,
std::initializer_list< value_type il 
)
inline

Requires: pos must be a valid iterator of *this.

Effects: Insert a copy of the [il.begin(), il.end()) range before pos.

Returns: an iterator to the first inserted element or pos if il.begin() == il.end().

Throws: If memory allocation throws, T's constructor from a dereferenced std::initializer_list throws or T's copy constructor throws.

Complexity: Linear to std::distance [il.begin(), il.end()).

template<class T , class Allocator >
template<class FwdIt >
iterator boost::container::deque< T, Allocator >::insert ( const_iterator  p,
FwdIt  first,
FwdIt  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< FwdIt, size_type >::value &&!container_detail::is_input_iterator< FwdIt >::value >::type = 0 
)
inline
template<class T , class Allocator >
size_type boost::container::deque< T, Allocator >::max_size ( ) const
inline

Effects: Returns the largest possible size of the deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::alloc(), and boost::container::allocator_traits< Allocator >::max_size().

template<class T , class Allocator >
deque& boost::container::deque< T, Allocator >::operator= ( BOOST_COPY_ASSIGN_REF(deque< T, Allocator >)  x)
inline

Effects: Makes *this contain the same elements as x.

Postcondition: this->size() == x.size(). *this contains a copy of each of x's elements.

Throws: If memory allocation throws or T's copy constructor throws.

Complexity: Linear to the number of elements in x.

References boost::container::deque_base< Allocator >::alloc(), boost::container::deque< T, Allocator >::assign(), boost::spirit::x3::bool_, boost::container::deque< T, Allocator >::clear(), boost::container::deque_base< Allocator >::ptr_alloc(), boost::container::deque< T, Allocator >::shrink_to_fit(), and boost::program_options::value().

template<class T , class Allocator >
deque& boost::container::deque< T, Allocator >::operator= ( BOOST_RV_REF(deque< T, Allocator >)  x)
inline

Effects: Move assignment.

All x's values are transferred to *this.

Throws: If allocator_traits_type::propagate_on_container_move_assignment is false and (allocation throws or value_type's move constructor throws)

Complexity: Constant if allocator_traits_type:: propagate_on_container_move_assignment is true or this->get>allocator() == x.get_allocator(). Linear otherwise.

References boost::container::deque_base< Allocator >::alloc(), boost::container::deque< T, Allocator >::assign(), BOOST_ASSERT, boost::container::deque< T, Allocator >::clear(), boost::make_move_iterator(), boost::container::deque_base< Allocator >::ptr_alloc(), boost::container::deque_base< Allocator >::swap_members(), boost::program_options::value(), boost::detail::void, and boost::flyweights::x.

template<class T , class Allocator >
deque& boost::container::deque< T, Allocator >::operator= ( std::initializer_list< value_type il)
inline

Effects: Makes *this contain the same elements as il.

Postcondition: this->size() == il.size(). *this contains a copy of each of x's elements.

Throws: If memory allocation throws or T's copy constructor throws.

Complexity: Linear to the number of elements in il.

template<class T , class Allocator >
reference boost::container::deque< T, Allocator >::operator[] ( size_type  n)
inline

Requires: size() > n.

Effects: Returns a reference to the nth element from the beginning of the container.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
const_reference boost::container::deque< T, Allocator >::operator[] ( size_type  n) const
inline

Requires: size() > n.

Effects: Returns a const reference to the nth element from the beginning of the container.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class Allocator >
ptr_alloc_ptr boost::container::deque_base< Allocator >::priv_allocate_map ( size_type  n)
inlineprotectedinherited
template<class Allocator >
const ptr_alloc_t& boost::container::deque_base< Allocator >::ptr_alloc ( ) const
inlineprotectedinherited
template<class T , class Allocator >
reverse_iterator boost::container::deque< T, Allocator >::rbegin ( )
inline

Effects: Returns a reverse_iterator pointing to the beginning of the reversed deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_finish, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
const_reverse_iterator boost::container::deque< T, Allocator >::rbegin ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_finish, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
reverse_iterator boost::container::deque< T, Allocator >::rend ( )
inline

Effects: Returns a reverse_iterator pointing to the end of the reversed deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
const_reverse_iterator boost::container::deque< T, Allocator >::rend ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the end of the reversed deque.

Throws: Nothing.

Complexity: Constant.

References boost::container::deque_base< Allocator >::members_holder::m_start, and boost::container::deque_base< Allocator >::members_.

template<class T , class Allocator >
void boost::container::deque< T, Allocator >::resize ( size_type  new_size)
inline

Effects: Inserts or erases elements at the end such that the size becomes n.

New elements are value initialized.

Throws: If memory allocation throws, or T's constructor throws.

Complexity: Linear to the difference between size() and new_size.

References boost::python::len(), and boost::container::deque< T, Allocator >::size().

template<class T , class Allocator >
void boost::container::deque< T, Allocator >::resize ( size_type  new_size,
default_init_t   
)
inline

Effects: Inserts or erases elements at the end such that the size becomes n.

New elements are default initialized.

Throws: If memory allocation throws, or T's constructor throws.

Complexity: Linear to the difference between size() and new_size.

Note: Non-standard extension

References boost::python::len(), and boost::container::deque< T, Allocator >::size().

template<class T , class Allocator >
void boost::container::deque< T, Allocator >::resize ( size_type  new_size,
const value_type x 
)
inline

Effects: Inserts or erases elements at the end such that the size becomes n.

New elements are copy constructed from x.

Throws: If memory allocation throws, or T's copy constructor throws.

Complexity: Linear to the difference between size() and new_size.

References boost::container::deque< T, Allocator >::erase(), boost::container::deque< T, Allocator >::insert(), boost::python::len(), boost::container::deque_base< Allocator >::members_holder::m_finish, boost::container::deque_base< Allocator >::members_holder::m_start, boost::container::deque_base< Allocator >::members_, boost::container::deque< T, Allocator >::size(), and boost::multiprecision::backends::this.

template<class T , class Allocator >
void boost::container::deque< T, Allocator >::shrink_to_fit ( )
inline

Effects: Tries to deallocate the excess of memory created with previous allocations.

The size of the deque is unchanged

Throws: If memory allocation throws.

Complexity: Constant.

References boost::container::deque< T, Allocator >::empty(), and boost::container::deque_base< Allocator >::priv_clear_map().

Referenced by boost::container::deque< T, Allocator >::operator=().

template<class T , class Allocator >
void boost::container::deque< T, Allocator >::swap ( deque< T, Allocator > &  x)
inline

Friends And Related Function Documentation

template<class T , class Allocator >
bool operator!= ( const deque< T, Allocator > &  x,
const deque< T, Allocator > &  y 
)
friend

Effects: Returns true if x and y are unequal

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator< ( const deque< T, Allocator > &  x,
const deque< T, Allocator > &  y 
)
friend

Effects: Returns true if x is less than y

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator<= ( const deque< T, Allocator > &  x,
const deque< T, Allocator > &  y 
)
friend

Effects: Returns true if x is equal or less than y

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator== ( const deque< T, Allocator > &  x,
const deque< T, Allocator > &  y 
)
friend

Effects: Returns true if x and y are equal

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator> ( const deque< T, Allocator > &  x,
const deque< T, Allocator > &  y 
)
friend

Effects: Returns true if x is greater than y

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator>= ( const deque< T, Allocator > &  x,
const deque< T, Allocator > &  y 
)
friend

Effects: Returns true if x is equal or greater than y

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
void swap ( deque< T, Allocator > &  x,
deque< T, Allocator > &  y 
)
friend

Effects: x.swap(y)

Complexity: Constant.

Member Data Documentation


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