mirror of https://github.com/CGAL/cgal
151 lines
4.2 KiB
TeX
151 lines
4.2 KiB
TeX
|
|
\ccHtmlNoClassLinks
|
|
\begin{ccClassTemplate} {deque<T>}
|
|
|
|
\ccSection{deque}
|
|
|
|
\ccDefinition
|
|
An object of the class \ccClassName\ is a sequence that supports
|
|
random access iterators. In addition it supports
|
|
constant time insert and erase operations at both ends. Insert and erase
|
|
in the middle take linear time.
|
|
|
|
% prevent dead links to non-CGAL include files
|
|
\ccHtmlLinksOff
|
|
\ccInclude{deque}
|
|
\ccHtmlLinksOn
|
|
|
|
\ccTypes
|
|
\ccNestedType{iterator}{A mutable random access iterator.}
|
|
\ccNestedType{const_iterator}{A const random access iterator.}
|
|
|
|
|
|
\ccCreation
|
|
\ccCreationVariable{D}
|
|
|
|
\ccConstructor{deque();}
|
|
{Introduces an empty deque.}
|
|
|
|
\ccConstructor{deque(const deque<T> &q);}
|
|
{Copy constructor.}
|
|
|
|
\ccConstructor{deque(int n, const T& t = T() );}
|
|
{Introduces a deque with $n$ items, all initialized to $t$.}
|
|
|
|
\ccOperations
|
|
\ccSetTwoOfThreeColumns{3.5cm}{3.1cm}
|
|
|
|
\ccMethod{deque<T> & operator=(const deque<T> &D1);}
|
|
{Assignment.}
|
|
|
|
|
|
\ccMethod{bool operator==(const deque<T> &D1) const;}
|
|
{Test for equality: Two deques are equal, iff they have the same size
|
|
and if their corresponding elements are equal.}
|
|
|
|
\ccMethod{bool operator!=(const deque<T> &D1) const;}
|
|
{Test for inequality.}
|
|
|
|
\ccMethod{bool operator<(const deque<T> &D1) const;}
|
|
{Test for lexicographically smaller.}
|
|
|
|
|
|
\ccMethod{iterator begin();}
|
|
{Returns a mutable iterator referring to the first element in
|
|
deque~\ccVar.}
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const_iterator begin() const;}
|
|
{Returns a constant iterator referring to the first element in
|
|
deque~\ccVar.}
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccTrue}
|
|
|
|
|
|
\ccMethod{iterator end();}
|
|
{Returns a mutable iterator which is the past-end-value of
|
|
deque~\ccVar.}
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const_iterator end() const;}
|
|
{Returns a constant iterator which is the past-end-value of
|
|
deque~\ccVar.}
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccTrue}
|
|
|
|
|
|
\ccMethod{bool empty() const;}
|
|
{Returns \ccStyle{true} if \ccVar\ is empty.}
|
|
|
|
\ccMethod{int size() const;}
|
|
{Returns the number of items in deque~\ccVar.}
|
|
|
|
\ccMethod{T& operator[](int pos);}
|
|
{Random access operator.}
|
|
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const T& operator[](int pos) const;}
|
|
{Random access operator.}
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccTrue}
|
|
|
|
|
|
\ccMethod{T& front();}
|
|
{Returns a reference to the first item in deque~\ccVar.}
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const T& front() const;}
|
|
{Returns a const reference to the first item in deque~\ccVar.}
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccTrue}
|
|
|
|
|
|
\ccMethod{T& back();}
|
|
{Returns a reference to the last item in deque~\ccVar.}
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const T& back() const;}
|
|
{Returns a const reference to the last item in deque~\ccVar.}
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccTrue}
|
|
|
|
|
|
\subsubsection*{Insert and Erase}
|
|
|
|
\ccMethod{void push_front(const T&);}
|
|
{Inserts an item at the beginning of deque~\ccVar.}
|
|
|
|
\ccMethod{void push_back(const T&);}
|
|
{Inserts an item at the end of deque~\ccVar.}
|
|
|
|
\ccMethod{iterator insert(iterator pos, const T& t = T());}
|
|
{Inserts a copy of \ccStyle{t} in front of iterator \ccStyle{pos}.
|
|
The return value points to the inserted item.}
|
|
|
|
\ccMethod{iterator insert(iterator pos,
|
|
int n, const T& t = T());}
|
|
{Inserts $n$ copy of \ccStyle{t} in front of iterator \ccStyle{pos}.
|
|
The return value points to the inserted item.}
|
|
|
|
|
|
\ccMethod{void insert(iterator pos,
|
|
const_iterator first,
|
|
const_iterator last);}
|
|
{Inserts a copy of the range $\left[\right.$\ccStyle{first}, \ccStyle{last}$\left.\right)$
|
|
in front of iterator \ccStyle{pos}.}
|
|
|
|
\ccMethod{void pop_front();}
|
|
{Removes the first item from deque~\ccVar.}
|
|
|
|
\ccMethod{void pop_back();}
|
|
{Removes the last item from deque~\ccVar.}
|
|
|
|
\ccMethod{void erase(iterator pos);}
|
|
{Removes the item from deque~\ccVar, where \ccStyle{pos} refers to.}
|
|
|
|
\ccMethod{void erase(iterator first,
|
|
iterator last);}
|
|
{Removes the items in the range$\left[\right.$\ccStyle{first},
|
|
\ccStyle{last}$\left.\right)$ from deque ~\ccVar.}
|
|
|
|
|
|
|
|
|
|
\end{ccClassTemplate}
|