⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<HTML><HEAD><TITLE>&lt;list&gt;</TITLE></HEAD><BODY><H1><A NAME="&lt;list&gt;"><CODE>&lt;list&gt;</CODE></A></H1><HR><P>Include the <A HREF="index.html#STL">STL</A>standard header <B><CODE>&lt;list&gt;</CODE></B> to define the<A HREF="lib_cont.html#Containers">container</A>template class <CODE>list</CODE> and several supportingtemplates.</P><PRE>namespace std {template&lt;class Ty, class Alloc&gt;    class <B><A HREF="#list">list</A></B>;        // TEMPLATE FUNCTIONStemplate&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator==">operator==</A></B>(        const list&lt;Ty, Alloc&gt;&amp; left,        const list&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator!=">operator!=</A></B>(        const list&lt;Ty, Alloc&gt;&amp; left,        const list&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator&lt;">operator&lt;</A></B>(        const list&lt;Ty, Alloc&gt;&amp; left,        const list&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator&gt;">operator&gt;</A></B>(        const list&lt;Ty, Alloc&gt;&amp; left,        const list&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator&lt;=">operator&lt;=</A></B>(        const list&lt;Ty, Alloc&gt;&amp; left,        const list&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator&gt;=">operator&gt;=</A></B>(        const list&lt;Ty, Alloc&gt;&amp; left,        const list&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    void <B><A HREF="#swap">swap</A></B>(        list&lt;Ty, Alloc&gt;&amp; left,        list&lt;Ty, Alloc&gt;&amp; right);    };</PRE><H2><A NAME="list"><CODE>list</CODE></A></H2><HR><P><B><CODE><A HREF="#list::allocator_type">allocator_type</A>&#183; <A HREF="#list::assign">assign</A>&#183; <A HREF="#list::back">back</A>&#183; <A HREF="#list::begin">begin</A>&#183; <A HREF="#list::clear">clear</A>&#183; <A HREF="#list::const_iterator">const_iterator</A>&#183; <A HREF="#list::const_pointer">const_pointer</A>&#183; <A HREF="#list::const_reference">const_reference</A>&#183; <A HREF="#list::const_reverse_iterator">const_reverse_iterator</A>&#183; <A HREF="#list::difference_type">difference_type</A>&#183; <A HREF="#list::empty">empty</A>&#183; <A HREF="#list::end">end</A>&#183; <A HREF="#list::erase">erase</A>&#183; <A HREF="#list::front">front</A>&#183; <A HREF="#list::get_allocator">get_allocator</A>&#183; <A HREF="#list::insert">insert</A>&#183; <A HREF="#list::iterator">iterator</A>&#183; <A HREF="#list::list">list</A>&#183; <A HREF="#list::max_size">max_size</A>&#183; <A HREF="#list::merge">merge</A>&#183; <A HREF="#list::pointer">pointer</A>&#183; <A HREF="#list::pop_back">pop_back</A>&#183; <A HREF="#list::pop_front">pop_front</A>&#183; <A HREF="#list::push_back">push_back</A>&#183; <A HREF="#list::push_front">push_front</A>&#183; <A HREF="#list::rbegin">rbegin</A>&#183; <A HREF="#list::reference">reference</A>&#183; <A HREF="#list::remove">remove</A>&#183; <A HREF="#list::remove_if">remove_if</A>&#183; <A HREF="#list::rend">rend</A>&#183; <A HREF="#list::resize">resize</A>&#183; <A HREF="#list::reverse">reverse</A>&#183; <A HREF="#list::reverse_iterator">reverse_iterator</A>&#183; <A HREF="#list::size">size</A>&#183; <A HREF="#list::size_type">size_type</A>&#183; <A HREF="#list::sort">sort</A>&#183; <A HREF="#list::splice">splice</A>&#183; <A HREF="#list::swap">swap</A>&#183; <A HREF="#list::unique">unique</A>&#183; <A HREF="#list::value_type">value_type</A></CODE></B></P><HR><PRE>template&lt;class Ty, class Alloc = allocator&lt;Ty&gt; &gt;    class <B>list</B> {public:    typedef Alloc <B><A HREF="#list::allocator_type">allocator_type</A></B>;    typedef typename Alloc::pointer <B><A HREF="#list::pointer">pointer</A></B>;    typedef typename Alloc::const_pointer        <B><A HREF="#list::const_pointer">const_pointer</A></B>;    typedef typename Alloc::reference <B><A HREF="#list::reference">reference</A></B>;    typedef typename Alloc::const_reference <B><A HREF="#list::const_reference">const_reference</A></B>;    typedef typename Alloc::value_type <B><A HREF="#list::value_type">value_type</A></B>;    typedef T0 <B><A HREF="#list::iterator">iterator</A></B>;    typedef T1 <B><A HREF="#list::const_iterator">const_iterator</A></B>;    typedef T2 <B><A HREF="#list::size_type">size_type</A></B>;    typedef T3 <B><A HREF="#list::difference_type">difference_type</A></B>;    typedef reverse_iterator&lt;const_iterator&gt;        <B><A HREF="#list::const_reverse_iterator">const_reverse_iterator</A></B>;    typedef reverse_iterator&lt;iterator&gt;        <B><A HREF="#list::reverse_iterator">reverse_iterator</A></B>;    <B><A HREF="#list::list">list</A></B>();    explicit <B><A HREF="#list::list">list</A></B>(const Alloc&amp; al);    explicit <B><A HREF="#list::list">list</A></B>(size_type count);    <B><A HREF="#list::list">list</A></B>(size_type count, const Ty&amp; val);    <B><A HREF="#list::list">list</A></B>(size_type count, const Ty&amp; val, const Alloc&amp; al);    <B><A HREF="#list::list">list</A></B>(const list&amp; right);    template&lt;class InIt&gt;        <B><A HREF="#list::list">list</A></B>(InIt first, InIt last);    template&lt;class InIt&gt;        <B><A HREF="#list::list">list</A></B>(InIt first, InIt last, const Alloc&amp; al);    iterator <B><A HREF="#list::begin">begin</A></B>();    const_iterator <B><A HREF="#list::begin">begin</A></B>() const;    iterator <B><A HREF="#list::end">end</A></B>();    const_iterator <B><A HREF="#list::end">end</A></B>() const;    reverse_iterator <B><A HREF="#list::rbegin">rbegin</A></B>();    const_reverse_iterator <B><A HREF="#list::rbegin">rbegin</A></B>() const;    reverse_iterator <B><A HREF="#list::rend">rend</A></B>();    const_reverse_iterator <B><A HREF="#list::rend">rend</A></B>() const;    void <B><A HREF="#list::resize">resize</A></B>(size_type newsize);    void <B><A HREF="#list::resize">resize</A></B>(size_type newsize, Ty val);    size_type <B><A HREF="#list::size">size</A></B>() const;    size_type <B><A HREF="#list::max_size">max_size</A></B>() const;    bool <B><A HREF="#list::empty">empty</A></B>() const;    Alloc <B><A HREF="#list::get_allocator">get_allocator</A></B>() const;    reference <B><A HREF="#list::front">front</A></B>();    const_reference <B><A HREF="#list::front">front</A></B>() const;    reference <B><A HREF="#list::back">back</A></B>();    const_reference <B><A HREF="#list::back">back</A></B>() const;    void <B><A HREF="#list::push_front">push_front</A></B>(const Ty&amp; val);    void <B><A HREF="#list::pop_front">pop_front</A></B>();    void <B><A HREF="#list::push_back">push_back</A></B>(const Ty&amp; val);    void <B><A HREF="#list::pop_back">pop_back</A></B>();    template&lt;class InIt&gt;        void <B><A HREF="#list::assign">assign</A></B>(InIt first, InIt last);    void <B><A HREF="#list::assign">assign</A></B>(size_type count, const Ty&amp; val);    iterator <B><A HREF="#list::insert">insert</A></B>(iterator where, const Ty&amp; val);    void <B><A HREF="#list::insert">insert</A></B>(iterator where, size_type count, const Ty&amp; val);    template&lt;class InIt&gt;        void <B><A HREF="#list::insert">insert</A></B>(iterator where, InIt first, InIt last);    iterator <B><A HREF="#list::erase">erase</A></B>(iterator where);    iterator <B><A HREF="#list::erase">erase</A></B>(iterator first, iterator last);    void <B><A HREF="#list::clear">clear</A></B>();    void <B><A HREF="#list::swap">swap</A></B>(list&amp; right);    void <B><A HREF="#list::splice">splice</A></B>(iterator where, list&amp; right);    void <B><A HREF="#list::splice">splice</A></B>(iterator where, list&amp; right, iterator first);    void <B><A HREF="#list::splice">splice</A></B>(iterator where, list&amp; right, iterator first,        iterator last);    void <B><A HREF="#list::remove">remove</A></B>(const Ty&amp; val);    templace&lt;class Pr1&gt;        void <B><A HREF="#list::remove_if">remove_if</A></B>(Pr1 pred);    void <B><A HREF="#list::unique">unique</A></B>();    template&lt;class Pr2&gt;        void <B><A HREF="#list::unique">unique</A></B>(Pr2 pred);    void <B><A HREF="#list::merge">merge</A></B>(list&amp; right);    template&lt;class Pr3&gt;        void <B><A HREF="#list::merge">merge</A></B>(list&amp; right, Pr3 pred);    void <B><A HREF="#list::sort">sort</A></B>();    template&lt;class Pr3&gt;        void <B><A HREF="#list::sort">sort</A></B>(Pr3 pred);    void <B><A HREF="#list::reverse">reverse</A></B>();    };</PRE><P>The template class describes an object that controls avarying-length sequence of elements of type <CODE>Ty</CODE>.The sequence is stored as a bidirectional linked list of elements,each containing a member of type <CODE>Ty</CODE>.</P><P>The object allocates and frees storage for the sequence it controlsthrough a stored <A HREF="memory.html#allocator object">allocator object</A>of class <CODE>Alloc</CODE>. Such an allocator object must havethe same external interface as an object of template class<A HREF="memory.html#allocator"><CODE>allocator</CODE></A>.Note that the stored allocator object is <I>not</I> copied when the containerobject is assigned.</P><P><B><A NAME="list reallocation">List reallocation</A></B>occurs when a member function must insert, erase, or splice elements ofthe controlled sequence. In all such cases, only iteratorsor references that designate erased or spliced elemetsof the controlled sequence become<B><A NAME="invalid list iterators">invalid</A></B>.</P><P>All additions to the controlled sequence occur as if by calls to<CODE><A HREF="#list::insert">insert</A></CODE>, which is theonly member function that calls the constructor<CODE>Ty(const Ty&amp;)</CODE>. If such an expression throwsan exception, the container object inserts no new elements and rethrowsthe exception. Thus, an object of template class <CODE>list</CODE>is left in a known state when such exceptions occur.</P><H3><CODE><A NAME="list::allocator_type">list::allocator_type</A></CODE></H3><PRE>typedef Alloc <B>allocator_type</B>;</PRE><P>The type is a synonym for the template parameter <CODE>Alloc</CODE>.</P><H3><CODE><A NAME="list::assign">list::assign</A></CODE></H3><PRE>template&lt;class InIt&gt;    void <B>assign</B>(InIt first, InIt last);void <B>assign</B>(size_type count, const Ty&amp; val);</PRE><P>If <CODE>InIt</CODE> is an integer type, the first memberfunction behaves the same as <CODE>assign((size_type)first, (Ty)last)</CODE>.Otherwise, thefirst member function replaces the sequencecontrolled by <CODE>*this</CODE> with the sequence<CODE>[first, last)</CODE>, which must <I>not</I> overlapthe initial controlled sequence.The second member function replaces the sequencecontrolled by <CODE>*this</CODE> with a repetition of <CODE>count</CODE>elements of value <CODE>val</CODE>.</P><H3><CODE><A NAME="list::back">list::back</A></CODE></H3><PRE>reference <B>back</B>();const_reference <B>back</B>() const;</PRE><P>The member function returns a reference to the last element of thecontrolled sequence, which must be non-empty.</P><H3><CODE><A NAME="list::begin">list::begin</A></CODE></H3><PRE>const_iterator <B>begin</B>() const;iterator <B>begin</B>();</PRE><P>The member function returns a bidirectional iterator that points atthe first element of the sequence (or just beyond the end of an emptysequence).</P><H3><CODE><A NAME="list::clear">list::clear</A></CODE></H3><PRE>void <B>clear</B>();</PRE><P>The member function calls<CODE><A HREF="#list::erase">erase</A>(<A HREF="#list::begin">begin</A>(),<A HREF="#list::end">end</A>())</CODE>.</P><H3><CODE><A NAME="list::const_iterator">list::const_iterator</A></CODE></H3><PRE>typedef T1 <B>const_iterator</B>;</PRE><P>The type describes an object that can serve as a constantbidirectional iterator for the controlled sequence.It is described here as asynonym for the implementation-defined type <CODE>T1</CODE>.</P><H3><CODE><A NAME="list::const_pointer">list::const_pointer</A></CODE></H3><PRE>typedef typename Alloc::const_pointer    <B>const_pointer</B>;</PRE><P>The type describes an object that can serve as a constant pointer

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -