std::deque::rbegin

reverse_iterator rbegin(); const_reverse_iterator rbegin() const; const_reverse_iterator crbegin() const; (since C++11) Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. Parameters (none). Return value Reverse iterator to the first element. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. See also rend crend r

std::deque::push_front

void push_front( const T& value ); void push_front( T&& value ); (since C++11) Prepends the given element value to the beginning of the container. All iterators, including the past-the-end iterator, are invalidated. No references are invalidated. Parameters value - the value of the element to prepend Return value (none). Complexity Constant. Exceptions If an exception is thrown, this function has no effect (strong exception guarantee). See also

std::deque::size

size_type size() const; Returns the number of elements in the container, i.e. std::distance(begin(), end()). Parameters (none). Return value The number of elements in the container. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. Example The following code uses size to display the number of elements in a std::deque: #include <deque> #include <iostream> int main() { std::deque<int> nums {1, 3

std::deque::resize

void resize( size_type count, T value = T() ); (until C++11) void resize( size_type count ); (1) (since C++11) void resize( size_type count, const value_type& value ); (2) (since C++11) Resizes the container to contain count elements. If the current size is greater than count, the container is reduced to its first count elements. If the current size is less than count, additional elements are appended and initialized with copies of value. (until C++11) If the current

std::deque::max_size

size_type max_size() const; Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container. Parameters (none). Return value Maximum number of elements. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. Notes This value is typically equal to std::numeric_limits<size_type>::max(), and reflects the

std::deque::operator[]

reference operator[]( size_type pos ); const_reference operator[]( size_type pos ) const; Returns a reference to the element at specified location pos. No bounds checking is performed. Parameters pos - position of the element to return Return value Reference to the requested element. Complexity Constant. Notes Unlike std::map::operator[], this operator never inserts a new element into the container. Example The following code uses operator[] to read f

std::deque::pop_front

void pop_front(); Removes the first element of the container. Iterators and references to the erased element are invalidated. It is unspecified whether the past-the-end iterator is invalidated if the element is the last element in the container. Other references and iterators are not affected. (since C++11) Iterators and references to the erased element are invalidated. If the element is the last element in the container, the past-the-end iterator is also invalidated. Other reference

std::deque::insert

(1) iterator insert( iterator pos, const T& value ); (until C++11) iterator insert( const_iterator pos, const T& value ); (since C++11) iterator insert( const_iterator pos, T&& value ); (2) (since C++11) (3) void insert( iterator pos, size_type count, const T& value ); (until C++11) iterator insert( const_iterator pos, size_type count, const T& value ); (since C++11) (4) template< class InputIt > void insert( iterator pos, InputIt f

std::deque::push_back

void push_back( const T& value ); (1) void push_back( T&& value ); (2) (since C++11) Appends the given element value to the end of the container. 1) The new element is initialized as a copy of value. 2) value is moved into the new element. All iterators, including the past-the-end iterator, are invalidated. No references are invalidated. Parameters value - the value of the element to append Type requirements - T must meet the requirements of CopyInsertabl

std::deque::pop_back

void pop_back(); Removes the last element of the container. Calling pop_back on an empty container is undefined. Iterators and references to the erased element are invalidated. It is unspecified whether the past-the-end iterator is invalidated. Other references and iterators are not affected. (until C++11) Iterators and references to the erased element are invalidated. The past-the-end iterator is also invalidated. Other references and iterators are not affected. (since C++11) P