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

📄 bitset.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<PRE>bitset&lt;Bits&gt; <B>operator&gt;&gt;</B>(const bitset&lt;Bits&gt;&amp; pos);</PRE><P>The member operator function returns <CODE>bitset(*this)<A HREF="#bitset::operator&gt;&gt;=">&gt;&gt;=</A> pos</CODE>.</P><H3><CODE><A NAME="bitset::operator&gt;&gt;=">bitset::operator&gt;&gt;=</A></CODE></H3><PRE>bitset&lt;Bits&gt;&amp; <B>operator&gt;&gt;=</B>(const bitset&lt;Bits&gt;&amp; pos);</PRE><P>The member function replaces each element of the bit sequence storedin <CODE>*this</CODE> with the element <CODE>pos</CODE> positions laterin the sequence. If no such later element exists, the function clearsthe bit. The function returns <CODE>*this</CODE>.</P><H3><CODE><A NAME="bitset::operator[]">bitset::operator[]</A></CODE></H3><PRE>bool <B>operator[]</B>(size_type pos) const;reference <B>operator[]</B>(size_type pos);</PRE><P>The member function returns an object of class<CODE><A HREF="#bitset::reference">reference</A></CODE>,which designates the bit at position <CODE>pos</CODE>,if the object can be modified. Otherwise, it returnsthe value of the bit at position <CODE>pos</CODE>in the bit sequence. If that position isinvalid, the behavior is undefined.</P><H3><CODE><A NAME="bitset::operator^=">bitset::operator^=</A></CODE></H3><PRE>bitset&lt;Bits&gt;&amp; <B>operator^=</B>(const bitset&lt;Bits&gt;&amp; right);</PRE><P>The member operator function replaces each element of the bit sequence storedin <CODE>*this</CODE> with the logicalEXCLUSIVE OR of its previous value andthe corresponding bit in <CODE>right</CODE>.The function returns <CODE>*this</CODE>.</P><H3><CODE><A NAME="bitset::operator|=">bitset::operator|=</A></CODE></H3><PRE>bitset&lt;Bits&gt;&amp; <B>operator|=</B>(const bitset&lt;Bits&gt;&amp; right);</PRE><P>The member operator function replaces each element of the bit sequence storedin <CODE>*this</CODE> with the logical OR of its previous value andthe corresponding bit in <CODE>right</CODE>.The function returns <CODE>*this</CODE>.</P><H3><CODE><A NAME="bitset::operator~">bitset::operator~</A></CODE></H3><PRE>bitset&lt;Bits&gt; <B>operator~</B>() const;</PRE><P>The member operator function returns<CODE>bitset(*this).<A HREF="#bitset::flip">flip</A>()</CODE>.</P><H3><CODE><A NAME="bitset::reference">bitset::reference</A></CODE></H3><PRE>class <B>reference</B> {public:    reference&amp; <B>operator=</B>(bool val};    reference&amp; <B>operator=</B>(const reference&amp; bitref);    bool <B>operator~</B>() const;    <B>operator bool</B>() const;    reference&amp; <B>flip</B>();    };</PRE><P>The member class describes an object that designates anindividual bit within the bit sequence. Thus, for <CODE>val</CODE>an object of type <CODE>bool</CODE>, <CODE>bs</CODE> and <CODE>bs2</CODE>objects of type <CODE>bitset&lt;Bits&gt;</CODE>, and<CODE>I</CODE> and <CODE>J</CODE>valid positions within such an object, the member functionsof class <CODE>reference</CODE> ensure that (in order):</P><UL><LI><B><CODE>bs[I] = val</CODE></B> stores <CODE>val</CODE> at bit position<CODE>I</CODE> in <CODE>bs</CODE></LI><LI><B><CODE>bs[I] = bs2[J]</CODE></B> stores the value of the bit<CODE>bs2[J]</CODE> at bit position<CODE>I</CODE> in <CODE>bs</CODE></LI><LI><B><CODE>val = ~bs[I]</CODE></B> stores the flipped value of the bit<CODE>bs[I]</CODE> in <CODE>val</CODE></LI><LI><B><CODE>val = bs[I]</CODE></B> stores the value of the bit<CODE>bs[I]</CODE> in <CODE>val</CODE></LI><LI><B><CODE>bs[I].flip()</CODE></B> stores the flipped value of the bit<CODE>bs[I]</CODE> back at bit position<CODE>I</CODE> in <CODE>bs</CODE></LI></UL><H3><CODE><A NAME="bitset::reset">bitset::reset</A></CODE></H3><PRE>bitset&lt;Bits&gt;&amp; <B>reset</B>();bitset&lt;Bits&gt;&amp; <B>reset</B>(size_t pos);</PRE><P>The first member function resets (or clears) all bits in the bit sequence,then returns <CODE>*this</CODE>.The second member function throws<CODE><A HREF="stdexcep.html#out_of_range">out_of_range</A></CODE> if<CODE><A HREF="#bitset::size">size</A>()&lt;= pos</CODE>. Otherwise, it resets the bitat position <CODE>pos</CODE>, then returns <CODE>*this</CODE>.</P><H3><CODE><A NAME="bitset::set">bitset::set</A></CODE></H3><PRE>bitset&lt;Bits&gt;&amp; <B>set</B>();bitset&lt;Bits&gt;&amp; <B>set</B>(size_t pos, bool val = true);</PRE><P>The first member function sets all bits in the bit sequence,then returns <CODE>*this</CODE>.The second member function throws<CODE><A HREF="stdexcep.html#out_of_range">out_of_range</A></CODE> if<CODE><A HREF="#bitset::size">size</A>()&lt;= pos</CODE>. Otherwise, it stores <CODE>val</CODE> in the bitat position <CODE>pos</CODE>, then returns <CODE>*this</CODE>.</P><H3><CODE><A NAME="bitset::size">bitset::size</A></CODE></H3><PRE>size_t <B>size</B>() const;</PRE><P>The member function returns <CODE>Bits</CODE>.</P><H3><CODE><A NAME="bitset::test">bitset::test</A></CODE></H3><PRE>bool <B>test</B>(size_t pos);</PRE><P>The member function throws<CODE><A HREF="stdexcep.html#out_of_range">out_of_range</A></CODE> if<CODE><A HREF="#bitset::size">size</A>()&lt;= pos</CODE>. Otherwise, it returns true only if the bitat position <CODE>pos</CODE> is set.</P><H3><CODE><A NAME="bitset::to_string">bitset::to_string</A></CODE></H3><PRE>template&lt;class Elem, class Tr, class Alloc&gt;    basic_string&lt;Elem, Tr, Alloc&gt; <B><A HREF="#bitset::to_string">to_string</A></B>() const;</PRE><P>The member function constructs <CODE>str</CODE>, an object of class<CODE>basic_string&lt;Elem, Tr, Alloc&gt;</CODE>.For each bit in the bit sequence, the functionappends <CODE>1</CODE> if the bit is set, otherwise <CODE>0</CODE>.The <I>last</I> element appended to <CODE>str</CODE> corresponds tobit position zero. The function returns <CODE>str</CODE>.</P><H3><CODE><A NAME="bitset::to_ulong">bitset::to_ulong</A></CODE></H3><PRE>unsigned long <B>to_ulong</B>() const;</PRE><P>The member function throws<CODE><A HREF="stdexcep.html#overflow_error">overflow_error</A></CODE>if any bit in the bit sequence has a bit value that cannot berepresented as a value of type <I>unsigned long.</I> Otherwise,it returns the sum of the bit values in the bit sequence.</P><H2><A NAME="operator&amp;"><CODE>operator&amp;</CODE></A></H2><PRE>template&lt;size_t Bits&gt;    bitset&lt;Bits&gt;        <B>operator&amp;</B>(const bitset&amp; left,            const bitset&amp; right);</PRE><P>The template function returns <CODE>(temp = left) &amp;= right</CODE>,where <CODE>temp</CODE> has type <CODE>bitset&lt;Bits&gt;</CODE>.</P><H2><A NAME="operator|"><CODE>operator|</CODE></A></H2><PRE>template&lt;size_t Bits&gt;    bitset&lt;Bits&gt;        <B>operator|</B>(const bitset&amp; left,            const bitset&amp; right);</PRE><P>The template function returns <CODE>(temp = left) |= right</CODE>,where <CODE>temp</CODE> has type <CODE>bitset&lt;Bits&gt;</CODE>.</P><H2><A NAME="operator^"><CODE>operator^</CODE></A></H2><PRE>template&lt;size_t Bits&gt;    bitset&lt;Bits&gt;        <B>operator^</B>(const bitset&amp; left,            const bitset&amp; right);</PRE><P>The template function returns <CODE>(temp = left) ^= right</CODE>,where <CODE>temp</CODE> has type <CODE>bitset&lt;Bits&gt;</CODE>.</P><H2><A NAME="operator&lt;&lt;"><CODE>operator&lt;&lt;</CODE></A></H2><PRE>template&lt;class Elem, class Tr, size_t Bits&gt;    basic_ostream&lt;Elem, Tr&gt;&amp;        <B>operator&lt;&lt;</B>(basic_ostream&lt;Elem, Tr&gt;&amp; ostr,            const bitset&lt;Bits&gt;&amp; right);</PRE><P>The template function overloads <CODE>operator&lt;&lt;</CODE>to insert a text representation of the bit sequence in <CODE>ostr</CODE>.It effectively executes <CODE>ostr &lt;&lt;right.<A HREF="#bitset::to_string">to_string</A>&lt;Elem,Tr, allocator&lt;Elem&gt; &gt;()</CODE>,then returns <CODE>ostr</CODE>.</P><H2><A NAME="operator&gt;&gt;"><CODE>operator&gt;&gt;</CODE></A></H2><PRE>template&lt;class Elem, class Tr, size_t Bits&gt;    basic_istream&lt;Elem, Tr&gt;&amp;        <B>operator&gt;&gt;</B>(basic_istream&lt;Elem, Tr&gt;&amp; istr,            bitset&lt;Bits&gt;&amp; right);</PRE><P>The template function overloads <CODE>operator&gt;&gt;</CODE>to store in <CODE>right</CODE> the value<CODE>bitset(str)</CODE>, where<CODE>str</CODE> is an object of type<CODE><A HREF="string2.html#basic_string">basic_string</A>&lt;Elem,Tr, allocator&lt;Elem&gt; &gt;&amp;</CODE> extractedfrom <CODE>istr</CODE>. The function extracts elements and appendsthem to <CODE>str</CODE> until:</P><UL><LI><CODE>Bits</CODE> elements have been extracted and stored</LI><LI>end-of-file occurs on the input sequence</LI><LI>the next input element is neither <CODE>0</CODE> nor <CODE>1</CODE>,in which case the input element is not extracted</LI></UL><P>If the function stores no characters in <CODE>str</CODE>, it calls<CODE>istr.<A HREF="ios.html#basic_ios::setstate">setstate</A>(ios_base::failbit)</CODE>.In any case, it returns <CODE>istr</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> &#169; 1992-2002by P.J. Plauger. All rights reserved.</I></P><!--V4.01:1125--></BODY></HTML>

⌨️ 快捷键说明

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