1 .. Metafunctions/Logical Operations//or_ |20
15 , typename F\ *n* = |unspecified|
19 typedef |unspecified| type;
27 Returns the result of short-circuit *logical or* (``||``) operation on its arguments.
35 #include <boost/mpl/or.hpp>
36 #include <boost/mpl/logical.hpp>
42 +---------------+---------------------------+-----------------------------------------------+
43 | Parameter | Requirement | Description |
44 +===============+===========================+===============================================+
45 | |F1...Fn| | Nullary |Metafunction| | Operation's arguments. |
46 +---------------+---------------------------+-----------------------------------------------+
52 For arbitrary nullary |Metafunction|\ s |f1...fn|:
56 typedef or_<f1,f2,\ |...|\ ,f\ *n*\>::type r;
62 ``r`` is ``true_`` if either of ``f1::type::value``, ``f2::type::value``,...
63 ``fn::type::value`` expressions evaluates to ``true``, and ``false_`` otherwise;
64 guarantees left-to-right evaluation; the operands subsequent to the first
65 ``f``\ *i* metafunction that evaluates to ``true`` are not evaluated.
67 .. ..........................................................................
71 typedef or_<f1,f2,\ |...|\ ,f\ *n*\> r;
81 struct r : or_<f1,f2,\ |...|\ ,f\ *n*\>::type {};
91 BOOST_MPL_ASSERT(( or_< true\_,true\_ > ));
92 BOOST_MPL_ASSERT(( or_< false\_,true\_ > ));
93 BOOST_MPL_ASSERT(( or_< true\_,false\_ > ));
94 BOOST_MPL_ASSERT_NOT(( or_< false\_,false\_ > ));
95 BOOST_MPL_ASSERT(( or_< true\_,unknown > )); // OK
96 BOOST_MPL_ASSERT(( or_< true\_,unknown,unknown > )); // OK too
102 |Metafunctions|, |Logical Operations|, |and_|, |not_|
105 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
106 Distributed under the Boost Software License, Version 1.0. (See accompanying
107 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)