Front Page / Metafunctions / Logical Operations / or_ |
template< typename F1 , typename F2 ... , typename Fn = unspecified > struct or_ { typedef unspecified type; };
Returns the result of short-circuit logical or (||) operation on its arguments.
#include <boost/mpl/or.hpp> #include <boost/mpl/logical.hpp>
Parameter | Requirement | Description |
---|---|---|
F1, F2,... Fn | Nullary Metafunction | Operation's arguments. |
For arbitrary nullary Metafunctions f1, f2,... fn:
typedef or_<f1,f2,...,fn>::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 fi metafunction that evaluates to true are not evaluated. |
typedef or_<f1,f2,...,fn> r;
Return type: | Integral Constant. |
---|---|
Semantics: | Equivalent to struct r : or_<f1,f2,...,fn>::type {}; |
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