Standard Template Library - STL C++

<deque>

Overview

Description

The <deque> header file defines the deque class, which is a sequence container such that entries can be added or removed from the front or back efficiently. Unlike built-in arrays, deques grow or shrink to approximately the size of the number of elements in the deque. Additionally, the file defines six relational operators and a swap function that are friend functions of the deque class. In comparison to a vector, a deque is favored when entries must frequently be added and removed from both the front and back to the sequence. An array is favored over a deque for frequent random accesses. As the name suggests, a deque is primarily for creating queues.

Classes


class deque<X, A>


Description

The deque class is a template class that can be instantiated to create sequential containers. A deque is primarily used for creating a queue, which requires entries to be added and removed from the start and end of the sequence frequently. The parameter X specifies the type that the container holds. The parameter A specifies the allocator that is used to perform allocation in the deque and is typically left as the default value, allocator<X>.

Members
Constructors

deque()

Typedefs

allocator_type

const_iterator

const_pointer

const_reference

const_reverse_iterator

difference_type

iterator

pointer

reference

reverse_iterator

size_type

value_type

Functions

assign()

at()

back()

begin()

cbegin()

cend()

clear()

crbegin()

crend()

emplace()

emplace_back()

emplace_front()

empty()

end()

erase()

front()

get_allocator()

insert()

max_size()

pop_back()

pop_front()

push_back()

push_front()

rbegin()

rend()

resize()

shrink_to_fit()

size()

swap()

operator[]()

operator=()

Friends

swap()

operator==()

operator!=()

operator<()

operator>()

operator<=()

operator>=()

 

© 2007–2024 XoaX.net LLC. All rights reserved.