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

📄 functio2.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<H2><A NAME="greater"><CODE>greater</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>greater</B> : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, bool&gt; {    bool <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left &gt; right</CODE>. The member function defines a<A HREF="utility.html#total ordering">total ordering</A>if <CODE>Ty</CODE> is an object pointer type. (It will compare two pointer valuesconsistently even if they don't point into the same array.)</P><H2><A NAME="greater_equal"><CODE>greater_equal</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>greater_equal</B>        : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, bool&gt; {    bool <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left &gt;= right</CODE>. The member function defines a<A HREF="utility.html#total ordering">total ordering</A>if <CODE>Ty</CODE> is an object pointer type. (It will compare two pointer valuesconsistently even if they don't point into the same array.)</P><H2><A NAME="less"><CODE>less</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>less</B> : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, bool&gt; {    bool <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left &lt; right</CODE>. The member function defines a<A HREF="utility.html#total ordering">total ordering</A>if <CODE>Ty</CODE> is an object pointer type. (It will compare two pointer valuesconsistently even if they don't point into the same array.)</P><H2><A NAME="less_equal"><CODE>less_equal</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>less_equal</B>        : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, bool&gt; {    bool <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left &lt;= right</CODE>. The member function defines a<A HREF="utility.html#total ordering">total ordering</A>if <CODE>Ty</CODE> is an object pointer type. (It will compare two pointer valuesconsistently even if they don't point into the same array.)</P><H2><A NAME="logical_and"><CODE>logical_and</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>logical_and</B>        : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, bool&gt; {    bool <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left &amp;&amp; right</CODE>.</P><H2><A NAME="logical_not"><CODE>logical_not</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>logical_not</B> : public <A HREF="#unary_function">unary_function</A>&lt;Ty, bool&gt; {    bool <B>operator()</B>(const Ty&amp; left) const;    };</PRE><P>The template class defines its member function as returning<CODE>!left</CODE>.</P><H2><A NAME="logical_or"><CODE>logical_or</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>logical_or</B>        : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, bool&gt; {    bool <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left || right</CODE>.</P><H2><A NAME="mem_fun"><CODE>mem_fun</CODE></A></H2><PRE>template&lt;class Result, class Ty&gt;    mem_fun_t&lt;Result, Ty&gt; <B>mem_fun</B>(Result (Ty::*pm)());template&lt;class Result, class Ty, class Arg&gt;    mem_fun1_t&lt;Result, Ty, Arg&gt; <B>mem_fun</B>(Result (Ty::*pm)(Arg));template&lt;class Result, class Ty&gt;    const_mem_fun_t&lt;Result, Ty&gt;        <B>mem_fun</B>(Result (Ty::*pm)() const);template&lt;class Result, class Ty, class Arg&gt;    const_mem_fun1_t&lt;Result, Ty, Arg&gt;        <B>mem_fun</B>(Result (Ty::*pm)(Arg) const);</PRE><P>The template function returns <CODE>pm</CODE> cast to the return type.</P><H2><A NAME="mem_fun_ref"><CODE>mem_fun_ref</CODE></A></H2><PRE>template&lt;class Result, class Ty&gt;    mem_fun_ref_t&lt;Result, Ty&gt; <B>mem_fun_ref</B>(Result (Ty::*pm)());template&lt;class Result, class Ty, class Arg&gt;    mem_fun1_ref_t&lt;Result, Ty, Arg&gt; <B>mem_fun_ref</B>(Result (Ty::*pm)(Arg));template&lt;class Result, class Ty&gt;    const_mem_fun_ref_t&lt;Result, Ty&gt; <B>mem_fun_ref</B>(Result (Ty::*pm)() const);template&lt;class Result, class Ty, class Arg&gt;    const_mem_fun1_ref_t&lt;Result, Ty, Arg&gt; <B>mem_fun_ref</B>(Result (Ty::*pm)(Arg) const);</PRE><P>The template function returns <CODE>pm</CODE> cast to the return type.</P><H2><A NAME="mem_fun_t"><CODE>mem_fun_t</CODE></A></H2><PRE>template&lt;class Result, class Ty&gt;    struct <B>mem_fun_t</B> : public <A HREF="#unary_function">unary_function</A>&lt;Ty *, Result&gt; {    explicit <B>mem_fun_t</B>(Result (Ty::*pm)());    Result <B>operator()</B>(Ty *pleft) const;    };</PRE><P>The template class stores a copy of <CODE>pm</CODE>, whichmust be a pointer to a member function of class <CODE>Ty</CODE>, ina private member object.It defines its member function <B><CODE>operator()</CODE></B>as returning <CODE>(pleft-&gt;*pm)()</CODE>.</P><H2><A NAME="mem_fun_ref_t"><CODE>mem_fun_ref_t</CODE></A></H2><PRE>template&lt;class Result, class Ty&gt;    struct <B>mem_fun_ref_t</B>        : public <A HREF="#unary_function">unary_function</A>&lt;Ty, Result&gt; {    explicit <B>mem_fun_t</B>(Result (Ty::*pm)());    Result <B>operator()</B>(Ty&amp; left) const;    };</PRE><P>The template class stores a copy of <CODE>pm</CODE>, whichmust be a pointer to a member function of class <CODE>Ty</CODE>, ina private member object.It defines its member function <B><CODE>operator()</CODE></B>as returning <CODE>(left.*pm)()</CODE>.</P><H2><A NAME="mem_fun1_t"><CODE>mem_fun1_t</CODE></A></H2><PRE>template&lt;class Result, class Ty, class Arg&gt;    struct <B>mem_fun1_t</B>        : public <A HREF="#binary_function">binary_function</A>&lt;Ty *, Arg, Result&gt; {    explicit <B>mem_fun1_t</B>(Result (Ty::*pm)(Arg));    Result <B>operator()</B>(Ty *pleft, Arg right) const;    };</PRE><P>The template class stores a copy of <CODE>pm</CODE>, whichmust be a pointer to a member function of class <CODE>Ty</CODE>, ina private member object.It defines its member function <B><CODE>operator()</CODE></B>as returning <CODE>(pleft-&gt;*pm)(right)</CODE>.</P><H2><A NAME="mem_fun1_ref_t"><CODE>mem_fun1_ref_t</CODE></A></H2><PRE>template&lt;class Result, class Ty, class Arg&gt;    struct <B>mem_fun1_ref_t</B>        : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Arg, Result&gt; {    explicit <B>mem_fun1_ref_t</B>(Result (Ty::*pm)(Arg));    Result <B>operator()</B>(Ty&amp; left, Arg right) const;    };</PRE><P>The template class stores a copy of <CODE>pm</CODE>, whichmust be a pointer to a member function of class <CODE>Ty</CODE>, ina private member object.It defines its member function <B><CODE>operator()</CODE></B>as returning <CODE>(left.*pm)(right)</CODE>.</P><H2><A NAME="minus"><CODE>minus</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>minus</B> : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, Ty&gt; {    Ty <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left - right</CODE>.</P><H2><A NAME="modulus"><CODE>modulus</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>modulus</B> : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, Ty&gt; {    Ty <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left % right</CODE>.</P><H2><A NAME="multiplies"><CODE>multiplies</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>multiplies</B> : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, Ty&gt; {    Ty <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left * right</CODE>.</P><H2><A NAME="negate"><CODE>negate</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>negate</B> : public <A HREF="#unary_function">unary_function</A>&lt;Ty, Ty&gt; {    Ty <B>operator()</B>(const Ty&amp; left) const;    };</PRE><P>The template class defines its member function as returning<CODE>-left</CODE>.</P><H2><A NAME="not1"><CODE>not1</CODE></A></H2><PRE>template&lt;class Fn1&gt;    <A HREF="#unary_negate">unary_negate</A>&lt;Fn1&gt; <B>not1</B>(const Fn1&amp; func);</PRE><P>The template function returns<CODE><A HREF="#unary_negate">unary_negate</A>&lt;Fn1&gt;(func)</CODE>.</P><H2><A NAME="not2"><CODE>not2</CODE></A></H2><PRE>template&lt;class Fn2&gt;    <A HREF="#binary_negate">binary_negate</A>&lt;Fn2&gt; <B>not2</B>(const Fn2&amp; func);</PRE><P>The template function returns<CODE><A HREF="#binary_negate">binary_negate</A>&lt;Fn2&gt;(func)</CODE>.</P><H2><A NAME="not_equal_to"><CODE>not_equal_to</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>not_equal_to</B>        : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, bool&gt; {    bool <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left != right</CODE>.</P><H2><A NAME="plus"><CODE>plus</CODE></A></H2><PRE>template&lt;class Ty&gt;    struct <B>plus</B> : public <A HREF="#binary_function">binary_function</A>&lt;Ty, Ty, Ty&gt; {    Ty <B>operator()</B>(const Ty&amp; left, const Ty&amp; right) const;    };</PRE><P>The template class defines its member function as returning<CODE>left + right</CODE>.</P><H2><A NAME="pointer_to_binary_function"><CODE>pointer_to_binary_function</CODE></A></H2><PRE>template&lt;class Arg1, class Arg2, class Result&gt;    class <B>pointer_to_binary_function</B>        : public <A HREF="#binary_function">binary_function</A>&lt;Arg1, Arg2, Result&gt; {public:    explicit <B>pointer_to_binary_function</B>(        Result (*pfunc)(Arg1, Arg2));    Result <B>operator()</B>(const Arg1 left, const Arg2 right) const;    };</PRE><P>The template class stores a copy of <CODE>pfunc</CODE>.It defines its member function <B><CODE>operator()</CODE></B>as returning <CODE>(*pfunc)(left, right)</CODE>.</P><H2><A NAME="pointer_to_unary_function"><CODE>pointer_to_unary_function</CODE></A></H2><PRE>template&lt;class Arg, class Result&gt;    class <B>pointer_to_unary_function</B>        : public <A HREF="#unary_function">unary_function</A>&lt;Arg, Result&gt; {public:    explicit <B>pointer_to_unary_function</B>(        Result (*pfunc)(Arg));    Result <B>operator()</B>(const Arg left) const;    };</PRE><P>The template class stores a copy of <CODE>pfunc</CODE>.It defines its member function <B><CODE>operator()</CODE></B>as returning <CODE>(*pfunc)(left)</CODE>.</P><H2><A NAME="ptr_fun"><CODE>ptr_fun</CODE></A></H2><PRE>template&lt;class Arg, class Result&gt;    pointer_to_unary_function&lt;Arg, Result&gt;        <B>ptr_fun</B>(Result (*pfunc)(Arg));template&lt;class Arg1, class Arg2, class Result&gt;    pointer_to_binary_function&lt;Arg1, Arg2, Result&gt;        <B>ptr_fun</B>(Result (*pfunc)(Arg1, Arg2));</PRE><P>The first template function returns<CODE><A HREF="#pointer_to_unary_function">pointer_to_unary_function</A>&lt;Arg, Result&gt;(pfunc)</CODE>.</P><P>The second template function returns<CODE><A HREF="#pointer_to_binary_function">pointer_to_binary_function</A>&lt;Arg1, Arg2, Result&gt;(pfunc)</CODE>.</P><H2><A NAME="unary_function"><CODE>unary_function</CODE></A></H2><PRE>template&lt;class Arg, class Result&gt;    struct <B>unary_function</B> {    typedef Arg <B>argument_type</B>;    typedef Result <B>result_type</B>;    };</PRE><P>The template class serves as a base for classes that definea member function of the form:</P><PRE>result_type operator()(const argument_type&amp;) const</PRE><P>or a similar form taking one argument.</P><P>Hence, all such<B><A NAME="unary functions">unary functions</A></B>can refer to their sole argument type as<B><A NAME="unary_function::argument_type"><CODE>argument_type</CODE></A></B>and their return type as<B><A NAME="unary_function::result_type"><CODE>result_type</CODE></A></B>.</P><H2><A NAME="unary_negate"><CODE>unary_negate</CODE></A></H2><PRE>template&lt;class Fn1&gt;    class <B>unary_negate</B>        : public <A HREF="#unary_function">unary_function</A>&lt;            typename Fn1::argument_type,            bool&gt; {public:    explicit <B>unary_negate</B>(const Fn1&amp; Func);    bool <B>operator()</B>(        const typename Fn1::argument_type&amp; left) const;    };</PRE><P>The template class stores a copy of <CODE>func</CODE>, whichmust be a <A HREF="#unary functions">unary function</A> object.It defines its member function <B><CODE>operator()</CODE></B>as returning <CODE>!func(left)</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; 1994-2002by P.J. Plauger. Portions derived from work<A HREF="crit_hp.html">copyright</A> &#169; 1994by Hewlett-Packard Company. All rights reserved.</I></P><!--V4.01:1125--></BODY></HTML>

⌨️ 快捷键说明

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