📄 lib_cont.html
字号:
<PRE>const_iterator <B>begin</B>() const;iterator <B>begin</B>();</PRE><P>The member function returns an iterator that points atthe first element of the sequence (or just beyond the end of an emptysequence).</P><H3><CODE><A NAME="Container::clear">Container::clear</A></CODE></H3><PRE>void <B>clear</B>();</PRE><P>The member function calls<CODE><A HREF="#Container::erase">erase</A>(<A HREF="#Container::begin">begin</A>(),<A HREF="#Container::end">end</A>())</CODE>.</P><H3><CODE><A NAME="Container::const_iterator">Container::const_iterator</A></CODE></H3><PRE>typedef T6 <B>const_iterator</B>;</PRE><P>The type describes an object that can serve as a constantiterator for the controlled sequence.It is described here as asynonym for the unspecified type <CODE>T6</CODE>.</P><H3><CODE><A NAME="Container::const_reference">Container::const_reference</A></CODE></H3><PRE>typedef T3 <B>const_reference</B>;</PRE><P>The type describes an object that can serve as a constant referenceto an element of the controlled sequence. It is described here as asynonym for the unspecified type <CODE>T3</CODE>(typically <CODE>Alloc::const_reference</CODE>).</P><H3><CODE><A NAME="Container::const_reverse_iterator">Container::const_reverse_iterator</A></CODE></H3><PRE>typedef T8 <B>const_reverse_iterator</B>;</PRE><P>The type describes an object that can serve as a constant reverseiterator for the controlled sequence. It is described here as asynonym for the unspecified type <CODE>T8</CODE> (typically<CODE><A HREF="iterator.html#reverse_iterator">reverse_iterator</A><<A HREF="#Container::const_iterator">const_iterator</A>></CODE>).</P><H3><CODE><A NAME="Container::difference_type">Container::difference_type</A></CODE></H3><PRE>typedef T1 <B>difference_type</B>;</PRE><P>The signed integer type describes an object that can represent thedifference between the addresses of any two elements in the controlledsequence. It is described here as asynonym for the unspecified type <CODE>T1</CODE>(typically <CODE>Alloc::difference_type</CODE>).</P><H3><CODE><A NAME="Container::empty">Container::empty</A></CODE></H3><PRE>bool <B>empty</B>() const;</PRE><P>The member function returns true for an empty controlled sequence.</P><H3><CODE><A NAME="Container::end">Container::end</A></CODE></H3><PRE>const_iterator <B>end</B>() const;iterator <B>end</B>();</PRE><P>The member function returns an iterator that pointsjust beyond the end of the sequence.</P><H3><CODE><A NAME="Container::erase">Container::erase</A></CODE></H3><PRE>iterator <B>erase</B>(iterator where);iterator <B>erase</B>(iterator first, iterator last);</PRE><P>The first member function removes the element of the controlledsequence pointed to by <CODE>where</CODE>. The second member functionremoves the elements of the controlled sequencein the range <CODE>[first, last)</CODE>.Both return an iterator that designates the first element remainingbeyond any elements removed, or<CODE><A HREF="#Container::end">end</A>()</CODE> if no such element exists.</P><P>The member functions throw an exception only if a copy operationthrows an exception.</P><H3><CODE><A NAME="Container::iterator">Container::iterator</A></CODE></H3><PRE>typedef T5 <B>iterator</B>;</PRE><P>The type describes an object that can serve as aniterator for the controlled sequence.It is described here as asynonym for the unspecified type <CODE>T5</CODE>.An object of type <CODE>iterator</CODE> can be castto an object of type<CODE><A HREF="#Container::const_iterator">const_iterator</A></CODE>.</P><H3><CODE><A NAME="Container::max_size">Container::max_size</A></CODE></H3><PRE>size_type <B>max_size</B>() const;</PRE><P>The member function returns the length of the longest sequence thatthe object can control, in constant time regardless of the length of thecontrolled sequence.</P><H3><CODE><A NAME="Container::rbegin">Container::rbegin</A></CODE></H3><PRE>const_reverse_iterator <B>rbegin</B>() const;reverse_iterator <B>rbegin</B>();</PRE><P>The member function returns a reverse iterator that designates thelast element of the controlled sequence. Hence, it designates thebeginning of the reverse sequence.</P><H3><CODE><A NAME="Container::reference">Container::reference</A></CODE></H3><PRE>typedef T2 <B>reference</B>;</PRE><P>The type describes an object that can serve as a reference to anelement of the controlled sequence. It is described here as asynonym for the unspecified type <CODE>T2</CODE>(typically <CODE>Alloc::reference</CODE>).An object of type <CODE>reference</CODE> can be castto an object of type<CODE><A HREF="#Container::const_reference">const_reference</A></CODE>.</P><H3><CODE><A NAME="Container::rend">Container::rend</A></CODE></H3><PRE>const_reverse_iterator <B>rend</B>() const;reverse_iterator <B>rend</B>();</PRE><P>The member function returns a reverse iterator that designates the(fictitious) element before the first element of the controlledsequence. Hence, it points just beyond the end of the reverse sequence.</P><H3><CODE><A NAME="Container::reverse_iterator">Container::reverse_iterator</A></CODE></H3><PRE>typedef T7 <B>reverse_iterator</B>;</PRE><P>The type describes an object that can serve as a reverse iteratorfor the controlled sequence. It is described here as asynonym for the unspecified type <CODE>T7</CODE> (typically<CODE><A HREF="iterator.html#reverse_iterator">reverse_iterator</A><<A HREF="#Container::iterator">iterator</A>></CODE>).</P><H3><CODE><A NAME="Container::size">Container::size</A></CODE></H3><PRE>size_type <B>size</B>() const;</PRE><P>The member function returns the length of the controlled sequence,in constant time regardless of the length of the controlled sequence.</P><H3><CODE><A NAME="Container::size_type">Container::size_type</A></CODE></H3><PRE>typedef T0 <B>size_type</B>;</PRE><P>The unsigned integer type describes an object that can represent thelength of any controlled sequence. It is described here as asynonym for the unspecified type <CODE>T0</CODE>(typically <CODE>Alloc::size_type</CODE>).</P><H3><CODE><A NAME="Container::swap">Container::swap</A></CODE></H3><PRE>void <B>swap</B>(Container& right);</PRE><P>The member function swaps the controlled sequences between<CODE>*this</CODE> and <CODE>right</CODE>. If<CODE><A NAME="Container::get_allocator">get_allocator</A>()== right.get_allocator()</CODE>, it does so in constant time. Otherwise,it performs a number of element assignments and constructor callsproportional to the number of elements in the two controlled sequences.</P><H3><CODE><A NAME="Container::value_type">Container::value_type</A></CODE></H3><PRE>typedef T4 <B>value_type</B>;</PRE><P>The type is a synonym for the template parameter <CODE>Ty</CODE>.It is described here as asynonym for the unspecified type <CODE>T4</CODE>(typically <CODE>Alloc::value_type</CODE>).</P><H2><A NAME="operator!="><CODE>operator!=</CODE></A></H2><PRE>template<class Ty> bool <B>operator!=</B>( const Container <Ty>& left, const Container <Ty>& right);</PRE><P>The template function returns <CODE>!(left == right)</CODE>.</P><H2><A NAME="operator=="><CODE>operator==</CODE></A></H2><PRE>template<class Ty> bool <B>operator==</B>( const Container <Ty>& left, const Container <Ty>& right);</PRE><P>The template function overloads <CODE>operator==</CODE> to comparetwo objects of template class<A HREF="#Container"><CODE>Container</CODE></A>. The function returns<CODE>left.<A HREF="#Container::size">size</A>() == right.size() &&<A HREF="algorith.html#equal">equal</A>(left.<A HREF="#Container::begin">begin</A>(), left.<A HREF="#Container::end">end</A>(), right.begin())</CODE>.</P><H2><A NAME="operator<"><CODE>operator<</CODE></A></H2><PRE>template<class Ty> bool <B>operator<</B>( const Container <Ty>& left, const Container <Ty>& right);</PRE><P>The template function overloads <CODE>operator<</CODE> to comparetwo objects of template class<A HREF="#Container"><CODE>Container</CODE></A>. The function returns<CODE><A HREF="algorith.html#lexicographical_compare">lexicographical_compare</A>(left.<A HREF="#Container::begin">begin</A>(), left.<A HREF="#Container::end">end</A>(), right.begin(), right.end())</CODE>.</P><H2><A NAME="operator<="><CODE>operator<=</CODE></A></H2><PRE>template<class Ty> bool <B>operator<=</B>( const Container <Ty>& left, const Container <Ty>& right);</PRE><P>The template function returns <CODE>!(right < left)</CODE>.</P><H2><A NAME="operator>"><CODE>operator></CODE></A></H2><PRE>template<class Ty> bool <B>operator></B>( const Container <Ty>& left, const Container <Ty>& right);</PRE><P>The template function returns <CODE>right < left</CODE>.</P><H2><A NAME="operator>="><CODE>operator>=</CODE></A></H2><PRE>template<class Ty> bool <B>operator>=</B>( const Container <Ty>& left, const Container <Ty>& right);</PRE><P>The template function returns <CODE>!(left < right)</CODE>.</P><H2><A NAME="swap"><CODE>swap</CODE></A></H2><PRE>template<class Ty> void <B>swap</B>( Container <Ty>& left, Container <Ty>& right);</PRE><P>The template function executes<CODE>left.<A HREF="#Container::swap">swap</A>(right)</CODE>.</P><HR><P>See also the<B><A HREF="index.html#Table of Contents">Table of Contents</A></B> and the<B><A HREF="_index.html">Index</A></B>.</P><P><I><A HREF="crit_pjp.html">Copyright</A> © 1994-2002by P.J. Plauger. Portions derived from work<A HREF="crit_hp.html">copyright</A> © 1994by Hewlett-Packard Company. All rights reserved.</I></P><!--V4.01:1125--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -