BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsl::deque< VALUE_TYPE, ALLOCATOR > Class Template Reference

#include <bslstl_deque.h>

Inheritance diagram for bsl::deque< VALUE_TYPE, ALLOCATOR >:
bsl::Deque_Base< VALUE_TYPE >

Public Types

typedef VALUE_TYPE & reference
 
typedef const VALUE_TYPE & const_reference
 
typedef Iterator iterator
 
typedef ConstIterator const_iterator
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef VALUE_TYPE value_type
 
typedef ALLOCATOR allocator_type
 
typedef AllocatorTraits::pointer pointer
 
typedef AllocatorTraits::const_pointer const_pointer
 
typedef bsl::reverse_iterator< Iterator > reverse_iterator
 
typedef bsl::reverse_iterator< ConstIterator > const_reverse_iterator
 
- Public Types inherited from bsl::Deque_Base< VALUE_TYPE >
typedef VALUE_TYPE & reference
 
typedef const VALUE_TYPE & const_reference
 
typedef Iterator iterator
 
typedef ConstIterator const_iterator
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef VALUE_TYPE value_type
 
typedef bsl::reverse_iterator< Iterator > reverse_iterator
 
typedef bsl::reverse_iterator< ConstIterator > const_reverse_iterator
 

Public Member Functions

 deque ()
 
 deque (const ALLOCATOR &basicAllocator)
 
 deque (size_type numElements, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 deque (size_type numElements, const VALUE_TYPE &value, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
template<class INPUT_ITERATOR >
 deque (INPUT_ITERATOR first, INPUT_ITERATOR last, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 deque (const deque &original)
 
 deque (const deque &original, const typename type_identity< ALLOCATOR >::type &basicAllocator)
 
 deque (BloombergLP::bslmf::MovableRef< deque > original)
 
 deque (BloombergLP::bslmf::MovableRef< deque > original, const typename type_identity< ALLOCATOR >::type &basicAllocator)
 
 ~deque ()
 Destroy this object.
 
dequeoperator= (const deque &rhs)
 
template<class INPUT_ITERATOR >
deque &operator=(BloombergLP::bslmf::MovableRef< deque > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits void assign (INPUT_ITERATOR first, INPUT_ITERATOR last)
 
void assign (size_type numElements, const VALUE_TYPE &value)
 
void reserve (size_type numElements)
 
void resize (size_type newSize)
 
void resize (size_type newSize, const VALUE_TYPE &value)
 
void shrink_to_fit ()
 
void push_front (const VALUE_TYPE &value)
 
void push_front (BloombergLP::bslmf::MovableRef< value_type > value)
 
void push_back (const VALUE_TYPE &value)
 
void push_back (BloombergLP::bslmf::MovableRef< value_type > value)
 
template<class... Args>
reference emplace_front (Args &&... arguments)
 
template<class... Args>
reference emplace_back (Args &&... arguments)
 
template<class... Args>
iterator emplace (const_iterator position, Args &&... arguments)
 
void pop_front ()
 
void pop_back ()
 
iterator insert (const_iterator position, const VALUE_TYPE &value)
 
iterator insert (const_iterator position, BloombergLP::bslmf::MovableRef< value_type > value)
 
iterator insert (const_iterator position, size_type numElements, const VALUE_TYPE &value)
 
template<class INPUT_ITERATOR >
iterator insert (const_iterator position, INPUT_ITERATOR first, INPUT_ITERATOR last)
 
iterator erase (const_iterator position)
 
iterator erase (const_iterator first, const_iterator last)
 
allocator_type get_allocator () const BSLS_KEYWORD_NOEXCEPT
 Return the allocator used by this deque to supply memory.
 
size_type max_size () const BSLS_KEYWORD_NOEXCEPT
 
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type privateAppend (INPUT_ITERATOR first, INPUT_ITERATOR last, std::random_access_iterator_tag)
 
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type privateAppend (INPUT_ITERATOR first, INPUT_ITERATOR last, std::input_iterator_tag)
 
template<class INTEGRAL_TYPE >
void privateInsertDispatch (const_iterator position, INTEGRAL_TYPE numElements, INTEGRAL_TYPE value, BloombergLP::bslmf::MatchArithmeticType, BloombergLP::bslmf::Nil)
 
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type privatePrepend (INPUT_ITERATOR first, INPUT_ITERATOR last, std::input_iterator_tag tag)
 
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type privatePrepend (INPUT_ITERATOR first, INPUT_ITERATOR last, std::bidirectional_iterator_tag)
 
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type privatePrepend (INPUT_ITERATOR first, INPUT_ITERATOR last, std::random_access_iterator_tag)
 
template<class INPUT_ITERATOR >
void assign (INPUT_ITERATOR first, INPUT_ITERATOR last)
 
template<class... Args>
deque< VALUE_TYPE, ALLOCATOR >::reference emplace_front (Args &&...arguments)
 
template<class... Args>
deque< VALUE_TYPE, ALLOCATOR >::reference emplace_back (Args &&...arguments)
 
template<class... Args>
deque< VALUE_TYPE, ALLOCATOR >::iterator emplace (const_iterator position, Args &&... arguments)
 
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::iterator insert (const_iterator position, INPUT_ITERATOR first, INPUT_ITERATOR last)
 
- Public Member Functions inherited from bsl::Deque_Base< VALUE_TYPE >
iterator begin () BSLS_KEYWORD_NOEXCEPT
 
iterator end () BSLS_KEYWORD_NOEXCEPT
 
reverse_iterator rbegin () BSLS_KEYWORD_NOEXCEPT
 
reverse_iterator rend () BSLS_KEYWORD_NOEXCEPT
 
reference operator[] (size_type position)
 
reference at (size_type position)
 
reference front ()
 
reference back ()
 
const_iterator begin () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator cbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator end () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator cend () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator rbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator crbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator rend () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator crend () const BSLS_KEYWORD_NOEXCEPT
 
size_type size () const BSLS_KEYWORD_NOEXCEPT
 Return the number of elements contained by this deque.
 
size_type capacity () const BSLS_KEYWORD_NOEXCEPT
 
bool empty () const BSLS_KEYWORD_NOEXCEPT
 
const_reference operator[] (size_type position) const
 
const_reference at (size_type position) const
 
const_reference front () const
 
const_reference back () const
 

Public Attributes

void swap(deque< VALUE_TYPE, ALLOCATOR > &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits void clear () BSLS_KEYWORD_NOEXCEPT
 

Friends

template<class VALUE_TYPE2 , class ALLOCATOR2 >
class Deque_BlockCreator
 
template<class VALUE_TYPE2 , class ALLOCATOR2 >
class Deque_BlockProctor
 
template<class VALUE_TYPE2 , class ALLOCATOR2 >
class Deque_Guard
 

Additional Inherited Members

- Protected Attributes inherited from bsl::Deque_Base< VALUE_TYPE >
BlockPtr * d_blocks_p
 
std::size_t d_blocksLength
 
IteratorImp d_start
 
IteratorImp d_finish
 

Detailed Description

template<class VALUE_TYPE, class ALLOCATOR = allocator<VALUE_TYPE>>
class bsl::deque< VALUE_TYPE, ALLOCATOR >

This class template provides an STL-compliant deque that conforms to the bslma::Allocator model. For the requirements of a deque class, consult the C++11 standard. In particular, this implementation offers the general rules that:

  1. A call to any method that would result in a deque having a size greater than the value returned by max_size triggers a call to bslstl::StdExceptUtil::throwLengthError.
  2. A call to an at method that attempts to access a position outside of the valid range of a deque triggers a call to bslstl::StdExceptUtil::throwOutOfRange.

Note that portions of the standard methods are implemented in Deque_Base, which is parameterized on only VALUE_TYPE in order to generate smaller debug strings.

This class:

  • supports a complete set of value-semantic operations
    • except for BDEX serialization
  • is exception-neutral
  • is alias-safe
  • is const thread-safe For terminology see bsldoc_glossary .

In addition, the following members offer a full guarantee of rollback: if an exception is thrown during the invocation of insert, push_front, or push_back on a pre-existing object, the object is left in a valid state and its value is unchanged.

Member Typedef Documentation

◆ allocator_type

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef ALLOCATOR bsl::deque< VALUE_TYPE, ALLOCATOR >::allocator_type

◆ const_iterator

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef ConstIterator bsl::deque< VALUE_TYPE, ALLOCATOR >::const_iterator

◆ const_pointer

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef AllocatorTraits::const_pointer bsl::deque< VALUE_TYPE, ALLOCATOR >::const_pointer

◆ const_reference

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef const VALUE_TYPE& bsl::deque< VALUE_TYPE, ALLOCATOR >::const_reference

◆ const_reverse_iterator

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef bsl::reverse_iterator<ConstIterator> bsl::deque< VALUE_TYPE, ALLOCATOR >::const_reverse_iterator

◆ difference_type

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef std::ptrdiff_t bsl::deque< VALUE_TYPE, ALLOCATOR >::difference_type

◆ iterator

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef Iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::iterator

◆ pointer

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef AllocatorTraits::pointer bsl::deque< VALUE_TYPE, ALLOCATOR >::pointer

◆ reference

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef VALUE_TYPE& bsl::deque< VALUE_TYPE, ALLOCATOR >::reference

◆ reverse_iterator

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef bsl::reverse_iterator<Iterator> bsl::deque< VALUE_TYPE, ALLOCATOR >::reverse_iterator

◆ size_type

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef std::size_t bsl::deque< VALUE_TYPE, ALLOCATOR >::size_type

◆ value_type

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
typedef VALUE_TYPE bsl::deque< VALUE_TYPE, ALLOCATOR >::value_type

Constructor & Destructor Documentation

◆ deque() [1/9]

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( )

◆ deque() [2/9]

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( const ALLOCATOR &  basicAllocator)
explicit

Create an empty deque. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used.

◆ deque() [3/9]

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( size_type  numElements,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)
explicit

Create a deque of the specified numElements size whose every element is value-initialized. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE_TYPE be default-insertable into this deque (see {Requirements on VALUE_TYPE}).

◆ deque() [4/9]

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( size_type  numElements,
const VALUE_TYPE &  value,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)

Create a deque of the specified numElements size whose every element has the specified value. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE_TYPE be copy-insertable into this deque (see {Requirements on VALUE_TYPE}).

◆ deque() [5/9]

template<class VALUE_TYPE , class ALLOCATOR >
template<class INPUT_ITERATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)

Create a deque initially containing copies of the values in the range starting at the specified first and ending immediately before the specified last iterators of the (template parameter) type INPUT_ITERATOR. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if the number of elements in [first .. last) exceeds the size returned by max_size . The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this deque, where i is a dereferenceable iterator in the range [first .. last) (see {Requirements on VALUE_TYPE}). The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

◆ deque() [6/9]

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( const deque< VALUE_TYPE, ALLOCATOR > &  original)

Create a deque that has the same value as the specified original object. Use the allocator returned by 'bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())' to supply memory. If the (template parameter) type ALLOCATOR is bsl::allocator (the default), the currently installed default allocator is used. This method requires that the (template parameter) VALUE_TYPE be copy-insertable into this deque (see {Requirements on VALUE_TYPE}).

◆ deque() [7/9]

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( const deque< VALUE_TYPE, ALLOCATOR > &  original,
const typename type_identity< ALLOCATOR >::type &  basicAllocator 
)

Create a deque that has the same value as the specified original object and that uses the specified basicAllocator to supply memory. This method requires that the (template parameter) VALUE_TYPE be copy-insertable into this deque (see {Requirements on VALUE_TYPE}). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) type ALLOCATOR is bsl::allocator (the default).

◆ deque() [8/9]

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( BloombergLP::bslmf::MovableRef< deque< VALUE_TYPE, ALLOCATOR > >  original)

Create a deque having the same value as the specified original object by moving (in constant time) the contents of original to the new deque. The allocator associated with original is propagated for use in the newly-created deque. original is left in a valid but unspecified state.

◆ deque() [9/9]

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::deque ( BloombergLP::bslmf::MovableRef< deque< VALUE_TYPE, ALLOCATOR > >  original,
const typename type_identity< ALLOCATOR >::type &  basicAllocator 
)

Create a deque having the same value as the specified original object that uses the specified basicAllocator to supply memory. The contents of original are moved (in constant time) to the new deque if basicAllocator == original.get_allocator(), and are move- inserted (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state. This method requires that the (template parameter) VALUE_TYPE be move-insertable into this deque (see {Requirements on VALUE_TYPE}). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).

◆ ~deque()

template<class VALUE_TYPE , class ALLOCATOR >
bsl::deque< VALUE_TYPE, ALLOCATOR >::~deque ( )

Member Function Documentation

◆ assign() [1/3]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
deque &operator=(BloombergLP::bslmf::MovableRef< deque > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits void bsl::deque< VALUE_TYPE, ALLOCATOR >::assign ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last 
)

Assign to this deque the values in the range starting at the specified first and ending immediately before the specified last iterators of the (template parameter) type INPUT_ITERATOR. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators] providing access to values of a type convertible to value_type, and value_type must be copy-assignable and emplace-constructible from *i into this deque, where i is a dereferenceable iterator in the range [first .. last) (see {Requirements on VALUE_TYPE}). The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

◆ assign() [2/3]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::assign ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last 
)

◆ assign() [3/3]

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::assign ( size_type  numElements,
const VALUE_TYPE &  value 
)

Assign to this object the value resulting from first clearing this deque and then appending the specified numElements having the specified value. This method requires that the (template parameter) VALUE_TYPE be copy-assignable and copy-insertable into this deque (see {Requirements on VALUE_TYPE}).

◆ emplace() [1/2]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class... Args>
iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::emplace ( const_iterator  position,
Args &&...  arguments 
)

Insert at the specified position in this deque a newly created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) arguments to the corresponding constructor of value_type, and return an iterator providing modifiable access to the newly created and inserted element. If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of value_type), this method has no effect. This method requires that the (template parameter) VALUE_TYPE be move-insertable into this deque and emplace-constructible from arguments (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()] (both endpoints included).

◆ emplace() [2/2]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class... Args>
deque< VALUE_TYPE, ALLOCATOR >::iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::emplace ( const_iterator  position,
Args &&...  arguments 
)

◆ emplace_back() [1/2]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class... Args>
reference bsl::deque< VALUE_TYPE, ALLOCATOR >::emplace_back ( Args &&...  arguments)

Append to the back of this deque a newly created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) arguments to the corresponding constructor of value_type. Return a reference providing modifiable access to the inserted element. If an exception is thrown (other than by the move constructor of a non-copy-insertable value_type), this method has no effect. This method requires that the (template parameter) VALUE_TYPE be move-insertable into this deque and emplace-constructible from arguments (see {Requirements on VALUE_TYPE}).

◆ emplace_back() [2/2]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class... Args>
deque< VALUE_TYPE, ALLOCATOR >::reference bsl::deque< VALUE_TYPE, ALLOCATOR >::emplace_back ( Args &&...  arguments)

◆ emplace_front() [1/2]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class... Args>
reference bsl::deque< VALUE_TYPE, ALLOCATOR >::emplace_front ( Args &&...  arguments)

Prepend to the front of this deque a newly created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) arguments to the corresponding constructor of value_type. Return a reference providing modifiable access to the inserted element. If an exception is thrown (other than by the move constructor of a non-copy-insertable value_type), this method has no effect. This method requires that the (template parameter) VALUE_TYPE be move-insertable into this deque and emplace-constructible from arguments (see {Requirements on VALUE_TYPE}).

◆ emplace_front() [2/2]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class... Args>
deque< VALUE_TYPE, ALLOCATOR >::reference bsl::deque< VALUE_TYPE, ALLOCATOR >::emplace_front ( Args &&...  arguments)

◆ erase() [1/2]

template<class VALUE_TYPE , class ALLOCATOR >
deque< VALUE_TYPE, ALLOCATOR >::iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::erase ( const_iterator  first,
const_iterator  last 
)

◆ erase() [2/2]

template<class VALUE_TYPE , class ALLOCATOR >
deque< VALUE_TYPE, ALLOCATOR >::iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::erase ( const_iterator  position)

Remove from this deque the element at the specified position, and return an iterator providing modifiable access to the element immediately following the removed element, or the position returned by the method end if the removed element was the last in the sequence. The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()).

◆ get_allocator()

template<class VALUE_TYPE , class ALLOCATOR >
deque< VALUE_TYPE, ALLOCATOR >::allocator_type bsl::deque< VALUE_TYPE, ALLOCATOR >::get_allocator ( ) const
inline

◆ insert() [1/5]

template<class VALUE_TYPE , class ALLOCATOR >
deque< VALUE_TYPE, ALLOCATOR >::iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::insert ( const_iterator  position,
BloombergLP::bslmf::MovableRef< value_type value 
)

Insert at the specified position in this deque the specified move-insertable value, and return an iterator providing modifiable access to the newly inserted element. value is left in a valid but unspecified state. If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of value_type), this method has no effect. This method requires that the (template parameter) VALUE_TYPE be move-insertable into this deque (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()] (both endpoints included).

◆ insert() [2/5]

template<class VALUE_TYPE , class ALLOCATOR >
deque< VALUE_TYPE, ALLOCATOR >::iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::insert ( const_iterator  position,
const VALUE_TYPE &  value 
)

Insert at the specified position in this deque a copy of the specified value, and return an iterator providing modifiable access to the newly inserted element. This method offers full guarantee of rollback in case an exception is thrown other than by the VALUE_TYPE copy constructor or assignment operator. This method requires that the (template parameter) VALUE_TYPE be copy-insertable into this deque (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range '[cbegin() .. cend()] (both endpoints included)'.

◆ insert() [3/5]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::insert ( const_iterator  position,
INPUT_ITERATOR  first,
INPUT_ITERATOR  last 
)

Insert at the specified position in this deque the values in the range starting at the specified first and ending immediately before the specified last iterators of the (template parameter) type INPUT_ITERATOR, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. This method offers full guarantee of rollback in case an exception is thrown other than by the VALUE_TYPE copy constructor or assignment operator. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this deque, where i is a dereferenceable iterator in the range [first .. last) (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()] (both endpoints included), and first and last refer to a sequence of valid values where first is at a position at or before last.

◆ insert() [4/5]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::insert ( const_iterator  position,
INPUT_ITERATOR  first,
INPUT_ITERATOR  last 
)
inline

◆ insert() [5/5]

template<class VALUE_TYPE , class ALLOCATOR >
deque< VALUE_TYPE, ALLOCATOR >::iterator bsl::deque< VALUE_TYPE, ALLOCATOR >::insert ( const_iterator  position,
size_type  numElements,
const VALUE_TYPE &  value 
)

Insert at the specified position in this deque the specified numElements copies of the specified value, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. This method offers full guarantee of rollback in case an exception is thrown other than by the VALUE_TYPE copy constructor or assignment operator. This method requires that the (template parameter) VALUE_TYPE be copy-insertable into this deque (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()] (both endpoints included).

◆ max_size()

template<class VALUE_TYPE , class ALLOCATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type bsl::deque< VALUE_TYPE, ALLOCATOR >::max_size ( ) const
inline

Return the maximum possible size of this deque. Note that this is a theoretical maximum (such as the maximum value that can be held by size_type). Also note that any request to create or enlarge a deque to a size greater than max_size() is guaranteed to raise a bsl::length_error exception.

◆ operator=()

template<class VALUE_TYPE , class ALLOCATOR >
deque< VALUE_TYPE, ALLOCATOR > & bsl::deque< VALUE_TYPE, ALLOCATOR >::operator= ( const deque< VALUE_TYPE, ALLOCATOR > &  rhs)

Assign to this object the value of the specified rhs object, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_copy_assignment, and return a reference providing modifiable access to this object. If an exception is thrown, *this is left in a valid but unspecified state. This method requires that the (template parameter) VALUE_TYPE be copy-assignable and copy-insertable into this deque (see {Requirements on VALUE_TYPE}).

◆ pop_back()

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::pop_back ( )

Erase the last element from this deque. The behavior is undefined if this deque is empty.

◆ pop_front()

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::pop_front ( )

Erase the first element from this deque. The behavior is undefined if this deque is empty.

◆ privateAppend() [1/2]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type bsl::deque< VALUE_TYPE, ALLOCATOR >::privateAppend ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
std::input_iterator_tag   
)

◆ privateAppend() [2/2]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type bsl::deque< VALUE_TYPE, ALLOCATOR >::privateAppend ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
std::random_access_iterator_tag   
)

◆ privateInsertDispatch()

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INTEGRAL_TYPE >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::privateInsertDispatch ( const_iterator  position,
INTEGRAL_TYPE  numElements,
INTEGRAL_TYPE  value,
BloombergLP::bslmf::MatchArithmeticType  ,
BloombergLP::bslmf::Nil   
)
inline

◆ privatePrepend() [1/3]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type bsl::deque< VALUE_TYPE, ALLOCATOR >::privatePrepend ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
std::bidirectional_iterator_tag   
)

◆ privatePrepend() [2/3]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type bsl::deque< VALUE_TYPE, ALLOCATOR >::privatePrepend ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
std::input_iterator_tag  tag 
)

◆ privatePrepend() [3/3]

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class INPUT_ITERATOR >
deque< VALUE_TYPE, ALLOCATOR >::size_type bsl::deque< VALUE_TYPE, ALLOCATOR >::privatePrepend ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
std::random_access_iterator_tag   
)

◆ push_back() [1/2]

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::push_back ( BloombergLP::bslmf::MovableRef< value_type value)

Append to the back of this deque the specified move-insertable value. value is left in a valid but unspecified state. If an exception is thrown (other than by the move constructor of a non-copy-insertable value_type), this method has no effect. This method requires that the (template parameter) VALUE_TYPE be move-insertable into this deque (see {Requirements on VALUE_TYPE}).

◆ push_back() [2/2]

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::push_back ( const VALUE_TYPE &  value)

Append to the back of this deque a copy of the specified value. This method offers full guarantee of rollback in case an exception is thrown. This method requires that the (template parameter) VALUE_TYPE be copy-constructible (see {Requirements on VALUE_TYPE}).

◆ push_front() [1/2]

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::push_front ( BloombergLP::bslmf::MovableRef< value_type value)

Prepend to the front of this deque the specified move-insertable value. value is left in a valid but unspecified state. If an exception is thrown (other than by the move constructor of a non-copy-insertable value_type), this method has no effect. This method requires that the (template parameter) VALUE_TYPE be move-insertable into this deque (see {Requirements on VALUE_TYPE}).

◆ push_front() [2/2]

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::push_front ( const VALUE_TYPE &  value)

Prepend to the front of this deque a copy of the specified value. This method offers full guarantee of rollback in case an exception is thrown. This method requires that the (template parameter) VALUE_TYPE be copy-constructible (see {Requirements on VALUE_TYPE}).

◆ reserve()

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::reserve ( size_type  numElements)

Change the capacity of this deque such that, after this method returns, iterators remain valid provided that no more than the specified numElements objects are pushed to the front or back of the deque after this call. If it is already possible to push numElements objects to either end of this deque without invalidating iterators, this method has no effect. Note that inserting elements into the deque may still incur memory allocation. Also note that this method, if it has any effect, will invalidate iterators initialized prior to the call. Also note that this method is not part of the C++ standard.

◆ resize() [1/2]

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::resize ( size_type  newSize)

◆ resize() [2/2]

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::resize ( size_type  newSize,
const VALUE_TYPE &  value 
)

Change the size of this deque to the specified newSize. Erase size() - newSize elements at the back if newSize < size(). Append newSize - size() elements at the back having the optionally specified value if newSize > size(); if value is not specified, value-initialized objects of the (template parameter) VALUE_TYPE are emplaced. This method has no effect if newSize == size(). Throw bsl::length_error if newSize > max_size().

◆ shrink_to_fit()

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::shrink_to_fit ( )

Minimize the memory used by this deque to the extent possible without moving any contained elements. If an exception is thrown, the value of this object is unchanged. Note that this method has no effect on the memory used by individual elements of the (template parameter) VALUE_TYPE.

Friends And Related Symbol Documentation

◆ Deque_BlockCreator

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class VALUE_TYPE2 , class ALLOCATOR2 >
friend class Deque_BlockCreator
friend

◆ Deque_BlockProctor

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class VALUE_TYPE2 , class ALLOCATOR2 >
friend class Deque_BlockProctor
friend

◆ Deque_Guard

template<class VALUE_TYPE , class ALLOCATOR = allocator<VALUE_TYPE>>
template<class VALUE_TYPE2 , class ALLOCATOR2 >
friend class Deque_Guard
friend

Member Data Documentation

◆ clear

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::deque< VALUE_TYPE, ALLOCATOR >::clear

Remove from this deque the sequence of elements starting at the specified first position and ending before the specified last position, and return an iterator providing modifiable access to the element immediately following the last removed element, or the position returned by the method end if the removed elements were last in the sequence. The behavior is undefined unless first is an iterator in the range [cbegin() .. cend()] (both endpoints included) and last is an iterator in the range [first .. cend()] (both endpoints included). Remove all elements from this deque making its size 0. Note that although this deque is empty after this method returns, it preserves the same capacity it had before the method was called.


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