STL‐compliant double‐ended sequence container using the bslma model.
Synopsis
Declared in <bslstl_deque.h>
template<
class VALUE_TYPE,
class ALLOCATOR = allocator<VALUE_TYPE>>
class deque
: public Deque_Base<VALUE_TYPE>
Description
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.
Base Classes
Name |
Description |
Allocator‐independent layout and accessors shared by |
Type Aliases
Name |
Description |
This |
|
This |
|
This |
|
This |
|
This |
|
This |
|
This |
|
This |
|
This |
|
This |
|
This |
|
This |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object. |
Assignment operators |
|
Append the elements of |
|
|
|
Assign to this deque the elements of |
|
|
|
|
|
|
|
Return how many end insertions remain before iterators are invalidated. |
|
Return an iterator providing non‐modifiable access to the first element in this deque, and the past‐the‐end iterator if this deque is empty. |
|
Return the past‐the‐end (forward) iterator providing non‐modifiable access to this deque. |
|
Remove all elements from this deque, leaving its capacity unchanged. |
|
Return a reverse iterator providing non‐modifiable access to the last element in this deque, and the past‐the‐end reverse iterator if this deque is empty. |
|
Return the past‐the‐end reverse iterator providing non‐modifiable access to this deque. |
|
Emplace a newly constructed element before |
|
Emplace a newly constructed element at the back of this deque. |
|
Emplace a newly constructed element at the front of this deque. |
|
Return |
|
|
|
|
|
|
|
Return the allocator used by this deque to supply memory. |
|
|
|
Insert the elements of |
|
Return the theoretical maximum size of this deque. |
|
Subscript operators |
|
Erase the last element from this deque. The behavior is undefined if this deque is empty. |
|
Erase the first element from this deque. The behavior is undefined if this deque is empty. |
|
Prepend the elements of |
|
|
|
|
|
|
|
|
|
Ensure capacity for |
|
|
|
Minimize unused capacity without moving contained elements. |
|
Return the number of elements contained by this deque. |
|
Exchange the value of this deque with that of |
Protected Data Members
Name |
Description |
Length of the |
|
Array of pointers to blocks (owned). |
|
The |
|
The |
Deduction Guides
Name |
Description |
Deduce the template parameter |
|
Deduce |
|
Deduce |
|
Deduce |
|
Deduce |
|
|
Deduce the template parameters |
Friends
Name |
Description |
Proctor for uncommitted elements constructed at one end of a deque. |
|
Proctor that deallocates empty blocks at one end of a deque. |
|
Helper that allocates tentative blocks at either end of a deque. |
Non-Member Functions
Name |
Description |
Erase every element of |
|
Erase every element of |
|
Perform a lexicographic three‐way comparison of |
|
Return |
|
Exchange the values of the specified |
Created with MrDocs