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

📄 set.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<HTML><HEAD><TITLE>&lt;set&gt;</TITLE></HEAD><BODY><H1><A NAME="&lt;set&gt;"><CODE>&lt;set&gt;</CODE></A></H1><HR><P>Include the <A HREF="index.html#STL">STL</A>standard header <B><CODE>&lt;set&gt;</CODE></B> to define the<A HREF="lib_cont.html#Containers">container</A>template classes <CODE>set</CODE> and<CODE>multiset</CODE>, and their supportingtemplates.</P><PRE>namespace std {template&lt;class Key, class Pr, class Alloc&gt;    class <B><A HREF="#set">set</A></B>;template&lt;class Key, class Pr, class Alloc&gt;    class <B><A HREF="#multiset">multiset</A></B>;        // TEMPLATE FUNCTIONStemplate&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator==">operator==</A></B>(        const set&lt;Key, Pr, Alloc&gt;&amp; left,        const set&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator==">operator==</A></B>(        const multiset&lt;Key, Pr, Alloc&gt;&amp; left,        const multiset&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator!=">operator!=</A></B>(        const set&lt;Key, Pr, Alloc&gt;&amp; left,        const set&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator!=">operator!=</A></B>(        const multiset&lt;Key, Pr, Alloc&gt;&amp; left,        const multiset&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator&lt;">operator&lt;</A></B>(        const set&lt;Key, Pr, Alloc&gt;&amp; left,        const set&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator&lt;">operator&lt;</A></B>(        const multiset&lt;Key, Pr, Alloc&gt;&amp; left,        const multiset&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator&gt;">operator&gt;</A></B>(        const set&lt;Key, Pr, Alloc&gt;&amp; left,        const set&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator&gt;">operator&gt;</A></B>(        const multiset&lt;Key, Pr, Alloc&gt;&amp; left,        const multiset&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator&lt;=">operator&lt;=</A></B>(        const set&lt;Key, Pr, Alloc&gt;&amp; left,        const set&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator&lt;=">operator&lt;=</A></B>(        const multiset&lt;Key, Pr, Alloc&gt;&amp; left,        const multiset&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator&gt;=">operator&gt;=</A></B>(        const set&lt;Key, Pr, Alloc&gt;&amp; left,        const set&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    bool <B><A HREF="#operator&gt;=">operator&gt;=</A></B>(        const multiset&lt;Key, Pr, Alloc&gt;&amp; left,        const multiset&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    void <B><A HREF="#swap">swap</A></B>(        set&lt;Key, Pr, Alloc&gt;&amp; left,        set&lt;Key, Pr, Alloc&gt;&amp; right);template&lt;class Key, class Pr, class Alloc&gt;    void <B><A HREF="#swap">swap</A></B>(        multiset&lt;Key, Pr, Alloc&gt;&amp; left,        multiset&lt;Key, Pr, Alloc&gt;&amp; right);    };</PRE><H2><A NAME="multiset"><CODE>multiset</CODE></A></H2><HR><P><B><CODE><A HREF="#multiset::allocator_type">allocator_type</A>&#183; <A HREF="#multiset::begin">begin</A>&#183; <A HREF="#multiset::clear">clear</A>&#183; <A HREF="#multiset::const_iterator">const_iterator</A>&#183; <A HREF="#multiset::const_pointer">const_pointer</A>&#183; <A HREF="#multiset::const_reference">const_reference</A>&#183; <A HREF="#multiset::const_reverse_iterator">const_reverse_iterator</A>&#183; <A HREF="#multiset::count">count</A>&#183; <A HREF="#multiset::difference_type">difference_type</A>&#183; <A HREF="#multiset::empty">empty</A>&#183; <A HREF="#multiset::end">end</A>&#183; <A HREF="#multiset::equal_range">equal_range</A>&#183; <A HREF="#multiset::erase">erase</A>&#183; <A HREF="#multiset::find">find</A>&#183; <A HREF="#multiset::get_allocator">get_allocator</A>&#183; <A HREF="#multiset::insert">insert</A>&#183; <A HREF="#multiset::iterator">iterator</A>&#183; <A HREF="#multiset::key_comp">key_comp</A>&#183; <A HREF="#multiset::key_compare">key_compare</A>&#183; <A HREF="#multiset::key_type">key_type</A>&#183; <A HREF="#multiset::lower_bound">lower_bound</A>&#183; <A HREF="#multiset::max_size">max_size</A>&#183; <A HREF="#multiset::multiset">multiset</A>&#183; <A HREF="#multiset::pointer">pointer</A>&#183; <A HREF="#multiset::rbegin">rbegin</A>&#183; <A HREF="#multiset::reference">reference</A>&#183; <A HREF="#multiset::rend">rend</A>&#183; <A HREF="#multiset::reverse_iterator">reverse_iterator</A>&#183; <A HREF="#multiset::size">size</A>&#183; <A HREF="#multiset::size_type">size_type</A>&#183; <A HREF="#multiset::swap">swap</A>&#183; <A HREF="#multiset::upper_bound">upper_bound</A>&#183; <A HREF="#multiset::value_comp">value_comp</A>&#183; <A HREF="#multiset::value_compare">value_compare</A>&#183; <A HREF="#multiset::value_type">value_type</A></CODE></B></P><HR><PRE>template&lt;class Key, class Pr = less&lt;Key&gt;,    class Alloc = allocator&lt;Key&gt; &gt;    class <B>multiset</B> {public:    typedef Key <B><A HREF="#multiset::key_type">key_type</A></B>;    typedef Pr <B><A HREF="#multiset::key_compare">key_compare</A></B>;    typedef Key <B><A HREF="#multiset::value_type">value_type</A></B>;    typedef Pr <B><A HREF="#multiset::value_compare">value_compare</A></B>;    typedef Allov <B><A HREF="#multiset::allocator_type">allocator_type</A></B>;    typedef Alloc::pointer <B><A HREF="#multiset::pointer">pointer</A></B>;    typedef Alloc::const_pointer <B><A HREF="#multiset::const_pointer">const_pointer</A></B>;    typedef Alloc::reference <B><A HREF="#multiset::reference">reference</A></B>;    typedef Alloc::const_reference <B><A HREF="#multiset::const_reference">const_reference</A></B>;    typedef T0 <B><A HREF="#multiset::iterator">iterator</A></B>;    typedef T1 <B><A HREF="#multiset::const_iterator">const_iterator</A></B>;    typedef T2 <B><A HREF="#multiset::size_type">size_type</A></B>;    typedef T3 <B><A HREF="#multiset::difference_type">difference_type</A></B>;    typedef reverse_iterator&lt;const_iterator&gt;        <B><A HREF="#multiset::const_reverse_iterator">const_reverse_iterator</A></B>;    typedef reverse_iterator&lt;iterator&gt; <B><A HREF="#multiset::reverse_iterator">reverse_iterator</A></B>;    <B><A HREF="#multiset::multiset">multiset</A></B>();    explicit <B><A HREF="#multiset::multiset">multiset</A></B>(const Pr&amp; pred);    <B><A HREF="#multiset::multiset">multiset</A></B>(const Pr&amp; pred, const Alloc&amp; al);    <B><A HREF="#multiset::multiset">multiset</A></B>(const multiset&amp; right);    template&lt;class InIt&gt;        <B><A HREF="#multiset::multiset">multiset</A></B>(InIt first, InIt last);    template&lt;class InIt&gt;        <B><A HREF="#multiset::multiset">multiset</A></B>(InIt first, InIt last,            const Pr&amp; pred);    template&lt;class InIt&gt;        <B><A HREF="#multiset::multiset">multiset</A></B>(InIt first, InIt last,            const Pr&amp; pred, const Alloc&amp; al);    iterator <B><A HREF="#multiset::begin">begin</A></B>();    const_iterator <B><A HREF="#multiset::begin">begin</A></B>() const;    iterator <B><A HREF="#multiset::end">end</A></B>();    const_iterator <B><A HREF="#multiset::end">end</A></B>() const;    reverse_iterator <B><A HREF="#multiset::rbegin">rbegin</A></B>();    const_reverse_iterator <B><A HREF="#multiset::rbegin">rbegin</A></B>() const;    reverse_iterator <B><A HREF="#multiset::rend">rend</A></B>();    const_reverse_iterator <B><A HREF="#multiset::rend">rend</A></B>() const;    size_type <B><A HREF="#multiset::max_size">max_size</A></B>() const;    bool <B><A HREF="#multiset::empty">empty</A></B>() const;    Alloc <B><A HREF="#multiset::get_allocator">get_allocator</A></B>() const;    iterator <B><A HREF="#multiset::insert">insert</A></B>(const value_type&amp; val);    iterator <B><A HREF="#multiset::insert">insert</A></B>(iterator where, const value_type&amp; val);    template&lt;class InIt&gt;        void <B><A HREF="#multiset::insert">insert</A></B>(InIt first, InIt last);    iterator <B><A HREF="#multiset::erase">erase</A></B>(iterator where);    iterator <B><A HREF="#multiset::erase">erase</A></B>(iterator first, iterator last);    size_type <B><A HREF="#multiset::erase">erase</A></B>(const Key&amp; keyval);    void <B><A HREF="#multiset::clear">clear</A></B>();    void <B><A HREF="#multiset::swap">swap</A></B>(multiset&amp; right);    key_compare <B><A HREF="#multiset::key_comp">key_comp</A></B>() const;    value_compare <B><A HREF="#multiset::value_comp">value_comp</A></B>() const;    iterator <B><A HREF="#multiset::find">find</A></B>(const Key&amp; keyval);    const_iterator <B><A HREF="#multiset::find">find</A></B>(const Key&amp; keyval) const;    size_type <B><A HREF="#multiset::count">count</A></B>(const Key&amp; keyval) const;    iterator <B><A HREF="#multiset::lower_bound">lower_bound</A></B>(const Key&amp; keyval);    const_iterator <B><A HREF="#multiset::lower_bound">lower_bound</A></B>(const Key&amp; keyval) const;    iterator <B><A HREF="#multiset::upper_bound">upper_bound</A></B>(const Key&amp; keyval);    const_iterator <B><A HREF="#multiset::upper_bound">upper_bound</A></B>(const Key&amp; keyval) const;    pair&lt;iterator, iterator&gt; <B><A HREF="#multiset::equal_range">equal_range</A></B>(const Key&amp; keyval);    pair&lt;const_iterator, const_iterator&gt;        <B><A HREF="#multiset::equal_range">equal_range</A></B>(const Key&amp; keyval) const;    };</PRE><P>The template class describes an object that controls avarying-length sequence of elements of type<CODE>const Key</CODE>.The sequence is<A HREF="lib_stl.html#sequence ordering">ordered by</A> the predicate<CODE>Pr</CODE>.Each element serves as both a <B>sort key</B> and a <B>value</B>.The sequence is represented in a way that permits lookup, insertion,and removal of an arbitrary element with a number of operationsproportional to the logarithm of the number of elementsin the sequence (logarithmic time). Moreover, inserting an elementinvalidates no iterators, and removing an elementinvalidates only those iterators which point at the removed element.</P><P>The object orders the sequence it controls by calling astored <B>function object</B> of type <CODE>Pr</CODE>. You accessthis stored object by calling the member function<CODE><A HREF="#multiset::key_comp">key_comp</A>()</CODE>.Such a function object must impose a<A HREF="lib_stl.html#strict weak ordering">strict weak ordering</A>on sort keys of type <CODE>Key</CODE>.For any element <CODE>X</CODE> that precedes<CODE>Y</CODE> in the sequence,<CODE>key_comp()(Y, X)</CODE> is false. (For the default function object<CODE><A HREF="functio2.html#less">less</A>&lt;Key&gt;</CODE>,sort keys never decrease in value.)Unlike template class <CODE><A HREF="#set">set</A></CODE>,an object of template class <CODE>multiset</CODE> does not ensure that<CODE>key_comp()(X, Y)</CODE> is true.(Keys need not be unique.)</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><H3><CODE><A NAME="multiset::allocator_type">multiset::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="multiset::begin">multiset::begin</A></CODE></H3><PRE>iterator <B>begin</B>();const_iterator <B>begin</B>() const;</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="multiset::clear">multiset::clear</A></CODE></H3><PRE>void <B>clear</B>();</PRE><P>The member function calls<CODE><A HREF="#multiset::erase">erase</A>(<A HREF="#multiset::begin">begin</A>(),<A HREF="#multiset::end">end</A>())</CODE>.</P><H3><CODE><A NAME="multiset::const_iterator">multiset::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="multiset::const_pointer">multiset::const_pointer</A></CODE></H3><PRE>typedef 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="multiset::const_reference">multiset::const_reference</A></CODE></H3><PRE>typedef 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="multiset::const_reverse_iterator">multiset::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 reversebidirectional iterator for the controlled sequence.</P><H3><CODE><A NAME="multiset::count">multiset::count</A></CODE></H3><PRE>size_type <B>count</B>(const Key&amp; keyval) const;</PRE><P>The member function returns the number of elementsin the range<CODE>[<A HREF="#multiset::lower_bound">lower_bound</A>(keyval),<A HREF="#multiset::upper_bound">upper_bound</A>(keyval)).</CODE></P><H3><CODE><A NAME="multiset::difference_type">multiset::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="multiset::empty">multiset::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="multiset::end">multiset::end</A></CODE></H3><PRE>iterator <B>end</B>();const_iterator <B>end</B>() const;</PRE>

⌨️ 快捷键说明

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