mirror of https://github.com/CGAL/cgal
132 lines
3.7 KiB
TeX
132 lines
3.7 KiB
TeX
|
|
\ccHtmlNoClassLinks
|
|
\begin{ccClassTemplate} {list<T>}
|
|
|
|
\ccSection{list}
|
|
|
|
\ccDefinition
|
|
An object of the class \ccClassName\ is a sequence that supports
|
|
bidirectional iterators and allows constant time insert and erase
|
|
operations anywhere within the sequence.
|
|
|
|
\ccInclude{list}
|
|
|
|
|
|
\ccTypes
|
|
\ccNestedType{iterator}{A mutable bidirectional iterator.}
|
|
\ccNestedType{const_iterator}{A const bidirectional iterator.}
|
|
|
|
\ccCreation
|
|
\ccCreationVariable{L}
|
|
|
|
|
|
\ccConstructor{list();}
|
|
{Introduces an empty list.}
|
|
|
|
\ccConstructor{list(const list<T> &q);}
|
|
{Copy constructor.}
|
|
|
|
\ccConstructor{list(int n, const T& t = T() );}
|
|
{Introduces a list with $n$ items, all initialized to $t$.}
|
|
|
|
|
|
|
|
\ccOperations
|
|
|
|
\ccMethod{list<T> & operator=(const list<T> &L1);}
|
|
{Assignment.}
|
|
|
|
\ccMethod{bool operator==(const list<T> &L1) const;}
|
|
{Test for equality: Two lists are equal, iff they have the same size
|
|
and if their corresponding elements are equal.}
|
|
|
|
\ccMethod{bool operator!=(const list<T> &L1) const;}
|
|
{Test for inequality.}
|
|
|
|
\ccMethod{iterator begin();}
|
|
{Returns a mutable iterator referring to the first element in
|
|
list~\ccVar.}
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const_iterator begin() const;}
|
|
{Returns a constant iterator referring to the first element in
|
|
list~\ccVar.}
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccTrue}
|
|
|
|
\ccMethod{iterator end();}
|
|
{Returns a mutable iterator which is the past-end-value of
|
|
list~\ccVar.}
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const_iterator end() const;}
|
|
{Returns a constant iterator which is the past-end-value of
|
|
list~\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 list~\ccVar.}
|
|
|
|
\ccMethod{T& front();}
|
|
{Returns a reference to the first item in list~\ccVar.}
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const T& front() const;}
|
|
{Returns a const reference to the first item in list~\ccVar.}
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccTrue}
|
|
|
|
\ccMethod{T& back();}
|
|
{Returns a reference to the last item in list~\ccVar.}
|
|
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccFalse}
|
|
\ccMethod{const T& back() const;}
|
|
{Returns a const reference to the last item in list~\ccVar.}
|
|
\renewcommand{\ccTagRmTrailingConst}{\ccTrue}
|
|
|
|
|
|
\ccHeading{Insertion}
|
|
|
|
\ccMethod{void push_front(const T&);}
|
|
{Inserts an item in front of list~\ccVar.}
|
|
|
|
\ccMethod{void push_back(const T&);}
|
|
{Inserts an item at the back of list~\ccVar.}
|
|
|
|
\ccMethod{iterator insert(iterator pos, const T& t);}
|
|
{Inserts a copy of \ccStyle{t} in front of iterator \ccStyle{pos}.
|
|
The return value points to the inserted item.}
|
|
|
|
\ccMethod{void insert(iterator pos,
|
|
int n, const T& t = T());}
|
|
{Inserts $n$ copies of \ccStyle{t} in front of iterator \ccStyle{pos}.}
|
|
|
|
|
|
\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}.}
|
|
|
|
\ccHeading{Removal}
|
|
|
|
\ccMethod{void pop_front();}
|
|
{Removes the first item from list~\ccVar.}
|
|
|
|
\ccMethod{void pop_back();}
|
|
{Removes the last item from list~\ccVar.}
|
|
|
|
\ccMethod{void erase(iterator pos);}
|
|
{Removes the item from list~\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 list~\ccVar.}
|
|
|
|
|
|
|
|
|
|
\end{ccClassTemplate}
|