and_.rst

来自「Boost provides free peer-reviewed portab」· RST 代码 · 共 110 行

RST
110
字号
.. Metafunctions/Logical Operations//and_ |10.. Copyright Aleksey Gurtovoy, David Abrahams 2007... Distributed under the Boost.. Software License, Version 1.0. (See accompanying.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)and\_=====Synopsis--------.. parsed-literal::        template<           typename F1        , typename F2        |...|        , typename F\ *n* = |unspecified|        >    struct and\_    {        typedef |unspecified| type;    };Description-----------Returns the result of short-circuit *logical and* (``&&``) operation on its arguments.Header------.. parsed-literal::        #include <boost/mpl/and.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 and_<f1,f2,\ |...|\ ,f\ *n*\>::type r;:Return type:    |Integral Constant|.:Semantics:    ``r`` is ``false_`` if either of ``f1::type::value``, ``f2::type::value``,...     ``fn::type::value`` expressions evaluates to ``false``, and ``true_`` otherwise;     guarantees left-to-right evaluation; the operands subsequent to the first     ``f``\ *i* metafunction that evaluates to ``false`` are not evaluated. .. ............................................................................ parsed-literal::    typedef and_<f1,f2,\ |...|\ ,f\ *n*\> r;:Return type:    |Integral Constant|.:Semantics:    Equivalent to     .. parsed-literal::            struct r : and_<f1,f2,\ |...|\ ,f\ *n*\>::type {};Example-------.. parsed-literal::        struct unknown;    BOOST_MPL_ASSERT(( and_< true\_,true\_ > ));    BOOST_MPL_ASSERT_NOT(( and_< false\_,true\_ > ));    BOOST_MPL_ASSERT_NOT(( and_< true\_,false\_ > ));    BOOST_MPL_ASSERT_NOT(( and_< false\_,false\_ > ));    BOOST_MPL_ASSERT_NOT(( and_< false\_,unknown > )); // OK    BOOST_MPL_ASSERT_NOT(( and_< false\_,unknown,unknown > )); // OK tooSee also--------|Metafunctions|, |Logical Operations|, |or_|, |not_|

⌨️ 快捷键说明

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