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

📄 or_.rst

📁 C++的一个好库。。。现在很流行
💻 RST
字号:
.. Metafunctions/Logical Operations//or_ |20

or\_
====

Synopsis
--------

.. parsed-literal::
    
    template< 
          typename F1
        , typename F2
        |...|
        , typename F\ *n* = |unspecified|
        >
    struct or\_
    {
        typedef |unspecified| type;
    };



Description
-----------

Returns the result of short-circuit *logical or* (``||``) operation on its arguments.


Header
------

.. parsed-literal::
    
    #include <boost/mpl/or.hpp>
    #include <boost/mpl/logical.hpp>


Parameters
----------

+---------------+---------------------------+-----------------------------------------------+
| Parameter     | Requirement               | Description                                   |
+===============+===========================+===============================================+
| |F1...Fn|     | Nullary |Metafunction|    | Operation's arguments.                        |
+---------------+---------------------------+-----------------------------------------------+


Expression semantics
--------------------

For arbitrary nullary |Metafunction|\ s |f1...fn|:

.. parsed-literal::

    typedef or_<f1,f2,\ |...|\ ,f\ *n*\>::type r;

:Return type:
    |Integral Constant|.

:Semantics:
    ``r`` is ``true_`` if either of ``f1::type::value``, ``f2::type::value``,... 
    ``fn::type::value`` expressions evaluates to ``true``, and ``false_`` otherwise; 
    guarantees left-to-right evaluation; the operands subsequent to the first 
    ``f``\ *i* metafunction that evaluates to ``true`` are not evaluated. 

.. ..........................................................................

.. parsed-literal::

    typedef or_<f1,f2,\ |...|\ ,f\ *n*\> r;

:Return type:
    |Integral Constant|.

:Semantics:
    Equivalent to 

    .. parsed-literal::
    
        struct r : or_<f1,f2,\ |...|\ ,f\ *n*\>::type {};


Example
-------

.. parsed-literal::
    
    struct unknown;

    BOOST_MPL_ASSERT(( or_< true\_,true\_ > ));
    BOOST_MPL_ASSERT(( or_< false\_,true\_ > ));
    BOOST_MPL_ASSERT(( or_< true\_,false\_ > ));
    BOOST_MPL_ASSERT_NOT(( or_< false\_,false\_ > ));
    BOOST_MPL_ASSERT(( or_< true\_,unknown > )); // OK
    BOOST_MPL_ASSERT(( or_< true\_,unknown,unknown > )); // OK too


See also
--------

|Metafunctions|, |Logical Operations|, |and_|, |not_|

⌨️ 快捷键说明

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