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

📄 deque.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<HTML><HEAD><TITLE>&lt;deque&gt;</TITLE></HEAD><BODY><H1><A NAME="&lt;deque&gt;"><CODE>&lt;deque&gt;</CODE></A></H1><HR><P>Include the <A HREF="index.html#STL">STL</A>standard header <B><CODE>&lt;deque&gt;</CODE></B> to define the<A HREF="lib_cont.html#Containers">container</A>template class <CODE>deque</CODE> and several supportingtemplates.</P><PRE>namespace std {template&lt;class Ty, class Alloc&gt;    class <B><A HREF="#deque">deque</A></B>;        // TEMPLATE FUNCTIONStemplate&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator==">operator==</A></B>(        const deque&lt;Ty, Alloc&gt;&amp; left,        const deque&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator!=">operator!=</A></B>(        const deque&lt;Ty, Alloc&gt;&amp; left,        const deque&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator&lt;">operator&lt;</A></B>(        const deque&lt;Ty, Alloc&gt;&amp; left,        const deque&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator&gt;">operator&gt;</A></B>(        const deque&lt;Ty, Alloc&gt;&amp; left,        const deque&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator&lt;=">operator&lt;=</A></B>(        const deque&lt;Ty, Alloc&gt;&amp; left,        const deque&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    bool <B><A HREF="#operator&gt;=">operator&gt;=</A></B>(        const deque&lt;Ty, Alloc&gt;&amp; left,        const deque&lt;Ty, Alloc&gt;&amp; right);template&lt;class Ty, class Alloc&gt;    void <B><A HREF="#swap">swap</A></B>(        deque&lt;Ty, Alloc&gt;&amp; left,        deque&lt;Ty, Alloc&gt;&amp; right);    };</PRE><H2><A NAME="deque"><CODE>deque</CODE></A></H2><HR><P><B><CODE><A HREF="#deque::allocator_type">allocator_type</A>&#183; <A HREF="#deque::assign">assign</A>&#183; <A HREF="#deque::at">at</A>&#183; <A HREF="#deque::back">back</A>&#183; <A HREF="#deque::begin">begin</A>&#183; <A HREF="#deque::clear">clear</A>&#183; <A HREF="#deque::const_iterator">const_iterator</A>&#183; <A HREF="#deque::const_pointer">const_pointer</A>&#183; <A HREF="#deque::const_reference">const_reference</A>&#183; <A HREF="#deque::const_reverse_iterator">const_reverse_iterator</A>&#183; <A HREF="#deque::deque">deque</A>&#183; <A HREF="#deque::difference_type">difference_type</A>&#183; <A HREF="#deque::empty">empty</A>&#183; <A HREF="#deque::end">end</A>&#183; <A HREF="#deque::erase">erase</A>&#183; <A HREF="#deque::front">front</A>&#183; <A HREF="#deque::get_allocator">get_allocator</A>&#183; <A HREF="#deque::insert">insert</A>&#183; <A HREF="#deque::iterator">iterator</A>&#183; <A HREF="#deque::max_size">max_size</A>&#183; <A HREF="#deque::operator[]">operator[]</A>&#183; <A HREF="#deque::pointer">pointer</A>&#183; <A HREF="#deque::pop_back">pop_back</A>&#183; <A HREF="#deque::pop_front">pop_front</A>&#183; <A HREF="#deque::push_back">push_back</A>&#183; <A HREF="#deque::push_front">push_front</A>&#183; <A HREF="#deque::rbegin">rbegin</A>&#183; <A HREF="#deque::reference">reference</A>&#183; <A HREF="#deque::rend">rend</A>&#183; <A HREF="#deque::resize">resize</A>&#183; <A HREF="#deque::reverse_iterator">reverse_iterator</A>&#183; <A HREF="#deque::size">size</A>&#183; <A HREF="#deque::size_type">size_type</A>&#183; <A HREF="#deque::swap">swap</A>&#183; <A HREF="#deque::value_type">value_type</A></CODE></B></P><HR><PRE>template&lt;class Ty, class Alloc = allocator&lt;Ty&gt; &gt;    class <B>deque</B> {public:    typedef Alloc <B><A HREF="#deque::allocator_type">allocator_type</A></B>;    typedef typename Alloc::pointer <B><A HREF="#deque::pointer">pointer</A></B>;    typedef typename Alloc::const_pointer <B><A HREF="#deque::const_pointer">const_pointer</A></B>;    typedef typename Alloc::reference <B><A HREF="#deque::reference">reference</A></B>;    typedef typename Alloc::const_reference <B><A HREF="#deque::const_reference">const_reference</A></B>;    typedef typename Alloc::value_type <B><A HREF="#deque::value_type">value_type</A></B>;    typedef T0 <B><A HREF="#deque::iterator">iterator</A></B>;    typedef T1 <B><A HREF="#deque::const_iterator">const_iterator</A></B>;    typedef T2 <B><A HREF="#deque::size_type">size_type</A></B>;    typedef T3 <B><A HREF="#deque::difference_type">difference_type</A></B>;    typedef reverse_iterator&lt;const_iterator&gt;        <B><A HREF="#deque::const_reverse_iterator">const_reverse_iterator</A></B>;    typedef reverse_iterator&lt;iterator&gt;        <B><A HREF="#deque::reverse_iterator">reverse_iterator</A></B>;    <B><A HREF="#deque::deque">deque</A></B>();    explicit <B><A HREF="#deque::deque">deque</A></B>(const Alloc&amp; al);    explicit <B><A HREF="#deque::deque">deque</A></B>(size_type count);    <B><A HREF="#deque::deque">deque</A></B>(size_type count, const Ty&amp; val);    <B><A HREF="#deque::deque">deque</A></B>(size_type count, const Ty&amp; val,        const Alloc&amp; al);    <B><A HREF="#deque::deque">deque</A></B>(const deque&amp; right);    template&lt;class InIt&gt;        <B><A HREF="#deque::deque">deque</A></B>(InIt first, InIt last);    template&lt;class InIt&gt;        <B><A HREF="#deque::deque">deque</A></B>(InIt first, InIt last, const Alloc&amp; al);    iterator <B><A HREF="#deque::begin">begin</A></B>();    const_iterator <B><A HREF="#deque::begin">begin</A></B>() const;    iterator <B><A HREF="#deque::end">end</A></B>();    const_iterator <B><A HREF="#deque::end">end</A></B>() const;    reverse_iterator <B><A HREF="#deque::rbegin">rbegin</A></B>();    const_reverse_iterator <B><A HREF="#deque::rbegin">rbegin</A></B>() const;    reverse_iterator <B><A HREF="#deque::rend">rend</A></B>();    const_reverse_iterator <B><A HREF="#deque::rend">rend</A></B>() const;    void <B><A HREF="#deque::resize">resize</A></B>(size_type newsize);    void <B><A HREF="#deque::resize">resize</A></B>(size_type newsize, Ty val);    size_type <B><A HREF="#deque::size">size</A></B>() const;    size_type <B><A HREF="#deque::max_size">max_size</A></B>() const;    bool <B><A HREF="#deque::empty">empty</A></B>() const;    Alloc <B><A HREF="#deque::get_allocator">get_allocator</A></B>() const;    reference <B><A HREF="#deque::at">at</A></B>(size_type pos);    const_reference <B><A HREF="#deque::at">at</A></B>(size_type pos) const;    reference <B><A HREF="#deque::operator[]">operator[]</A></B>(size_type pos);    const_reference <B><A HREF="#deque::operator[]">operator[]</A></B>(size_type pos);    reference <B><A HREF="#deque::front">front</A></B>();    const_reference <B><A HREF="#deque::front">front</A></B>() const;    reference <B><A HREF="#deque::back">back</A></B>();    const_reference <B><A HREF="#deque::back">back</A></B>() const;    void <B><A HREF="#deque::push_front">push_front</A></B>(const Ty&amp; val);    void <B><A HREF="#deque::pop_front">pop_front</A></B>();    void <B><A HREF="#deque::push_back">push_back</A></B>(const Ty&amp; val);    void <B><A HREF="#deque::pop_back">pop_back</A></B>();    template&lt;class InIt&gt;        void <B><A HREF="#deque::assign">assign</A></B>(InIt first, InIt last);    void <B><A HREF="#deque::assign">assign</A></B>(size_type count, const Ty&amp; val);    iterator <B><A HREF="#deque::insert">insert</A></B>(iterator where, const Ty&amp; val);    void <B><A HREF="#deque::insert">insert</A></B>(iterator where, size_type count, const Ty&amp; val);    template&lt;class InIt&gt;        void <B><A HREF="#deque::insert">insert</A></B>(iterator where, InIt first, InIt last);    iterator <B><A HREF="#deque::erase">erase</A></B>(iterator where);    iterator <B><A HREF="#deque::erase">erase</A></B>(iterator first, iterator last);    void <B><A HREF="#deque::clear">clear</A></B>();    void <B><A HREF="#deque::swap">swap</A></B>(deque&amp; right);    };</PRE><P>The template class describes an object that controls avarying-length sequence of elements of type <CODE>Ty</CODE>.The sequence is represented in a way that permits insertionand removal of an element at either end with a single element copy(constant time).Such operations in the middle of the sequence require elementcopies and assignments proportional to the number of elementsin the sequence (linear time).</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="deque reallocation">Deque reallocation</A></B>occurs when a member function must insert or erase elements ofthe controlled sequence:</P><UL><LI>If an element is inserted into an empty sequence,or if an element is erased to leave an empty sequence, theniterators earlier returned by<CODE><A HREF="#deque::begin">begin</A>()</CODE> and<CODE><A HREF="#deque::end">end</A>()</CODE> become<B><A NAME="invalid deque iterators">invalid</A></B>.</LI><LI>If an element is inserted at <CODE>begin()</CODE> or at<CODE><A HREF="#deque::end">end</A>()</CODE>,then all iterators become invalid, but no referencesthat designate existing elements become invalid.</LI><LI>If an element is erased at <CODE>begin()</CODE> or at<CODE><A HREF="#deque::end">end</A>()</CODE>,then only iterators and references that designate the erased elementbecome invalid.</LI><LI>Otherwise, inserting or erasing an element invalidatesall iterators and references.</LI></UL><H3><CODE><A NAME="deque::allocator_type">deque::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="deque::assign">deque::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="deque::at">deque::at</A></CODE></H3><PRE>const_reference <B>at</B>(size_type pos) const;reference <B>at</B>(size_type pos);</PRE><P>The member function returns a reference to the element of thecontrolled sequence at position <CODE>pos</CODE>. If that position isinvalid, the function throws an object of class<CODE>out_of_range</CODE>.</P><H3><CODE><A NAME="deque::back">deque::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="deque::begin">deque::begin</A></CODE></H3><PRE>const_iterator <B>begin</B>() const;iterator <B>begin</B>();</PRE><P>The member function returns a random-access iterator that points atthe first element of the sequence (or just beyond the end of an emptysequence).</P><H3><CODE><A NAME="deque::clear">deque::clear</A></CODE></H3><PRE>void <B>clear</B>();</PRE><P>The member function calls<CODE><A HREF="#deque::erase">erase</A>(<A HREF="#deque::begin">begin</A>(),<A HREF="#deque::end">end</A>())</CODE>.</P><H3><CODE><A NAME="deque::const_iterator">deque::const_iterator</A></CODE></H3><PRE>typedef T1 <B>const_iterator</B>;</PRE><P>The type describes an object that can serve as a constantrandom-access iterator for the controlled sequence.It is described here as asynonym for the implementation-defined type <CODE>T1</CODE>.</P><H3><CODE><A NAME="deque::const_pointer">deque::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 pointerto an element of the controlled sequence.</P><H3><CODE><A NAME="deque::const_reference">deque::const_reference</A></CODE></H3><PRE>typedef typename Alloc::const_reference <B>const_reference</B>;</PRE><P>The type describes an object that can serve as a constant referenceto an element of the controlled sequence.</P><H3><CODE><A NAME="deque::const_reverse_iterator">deque::const_reverse_iterator</A></CODE></H3><PRE>typedef reverse_iterator&lt;const_iterator&gt;    <B>const_reverse_iterator</B>;</PRE><P>The type describes an object that can serve as a constant reverserandom-access iterator for the controlled sequence.</P><H3><CODE><A NAME="deque::deque">deque::deque</A></CODE></H3><PRE><B>deque</B>();explicit <B>deque</B>(const Alloc&amp; al);explicit <B>deque</B>(size_type count);<B>deque</B>(size_type count, const Ty&amp; val);<B>deque</B>(size_type count, const Ty&amp; val,    const Alloc&amp; al);<B>deque</B>(const deque&amp; right);template&lt;class InIt&gt;    <B>deque</B>(InIt first, InIt last);template&lt;class InIt&gt;    <B>deque</B>(InIt first, InIt last, const Alloc&amp; al);</PRE><P>All constructors store an<A HREF="memory.html#allocator object">allocator object</A> andinitialize the controlled sequence. The allocator object is the argument<CODE>al</CODE>, if present. For the copy constructor, it is<CODE>right.<A HREF="#deque::get_allocator">get_allocator</A>()</CODE>.Otherwise, it is <CODE>Alloc()</CODE>.</P><P>The first two constructors specify anempty initial controlled sequence. The third constructor specifiesa repetition of <CODE>count</CODE> elements of value <CODE>Ty()</CODE>.The fourth and fifth constructors specifya repetition of <CODE>count</CODE> elements of value <CODE>val</CODE>.The sixth constructor specifies a copy of the sequence controlled by<CODE>right</CODE>.If <CODE>InIt</CODE> is an integer type, the last two constructorsspecify a repetition of <CODE>(size_type)first</CODE> elements of value<CODE>(Ty)last</CODE>. Otherwise, thelast two constructors specify the sequence<CODE>[first, last)</CODE>.</P><H3><CODE><A NAME="deque::difference_type">deque::difference_type</A></CODE></H3><PRE>typedef T3 <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 implementation-defined type <CODE>T3</CODE>.</P><H3><CODE><A NAME="deque::empty">deque::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="deque::end">deque::end</A></CODE></H3>

⌨️ 快捷键说明

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