1 .. Metafunctions/Bitwise Operations//bitor_
14 , typename T3 = |unspecified|
16 , typename T\ *n* = |unspecified|
20 typedef |unspecified| type;
28 Returns the result of *bitwise or* (``|``) operation of its arguments.
36 #include <boost/mpl/bitor.hpp>
37 #include <boost/mpl/bitwise.hpp>
43 |Numeric Metafunction|
49 +---------------+---------------------------+-----------------------------------------------+
50 | Parameter | Requirement | Description |
51 +===============+===========================+===============================================+
52 | |T1...Tn| | |Integral Constant| | Operation's arguments. |
53 +---------------+---------------------------+-----------------------------------------------+
55 |Note:| |numeric metafunction note| |-- end note|
61 For any |Integral Constant|\ s |c1...cn|:
66 typedef bitor_<c1,\ |...|\ c\ *n*\>::type r;
77 typeof(c1::value | c2::value)
78 , ( c1::value | c2::value )
81 typedef bitor_<c,c3,\ |...|\c\ *n*\>::type r;
83 .. ..........................................................................
87 typedef bitor_<c1,\ |...|\ c\ *n*\> r;
97 struct r : bitor_<c1,\ |...|\ c\ *n*\>::type {};
103 Amortized constant time.
111 typedef integral_c<unsigned,0> u0;
112 typedef integral_c<unsigned,1> u1;
113 typedef integral_c<unsigned,2> u2;
114 typedef integral_c<unsigned,8> u8;
115 typedef integral_c<unsigned,0xffffffff> uffffffff;
117 BOOST_MPL_ASSERT_RELATION( (bitor_<u0,u0>::value), ==, 0 );
118 BOOST_MPL_ASSERT_RELATION( (bitor_<u1,u0>::value), ==, 1 );
119 BOOST_MPL_ASSERT_RELATION( (bitor_<u0,u1>::value), ==, 1 );
120 BOOST_MPL_ASSERT_RELATION( (bitor_<u0,uffffffff>::value), ==, 0xffffffff );
121 BOOST_MPL_ASSERT_RELATION( (bitor_<u1,uffffffff>::value), ==, 0xffffffff );
122 BOOST_MPL_ASSERT_RELATION( (bitor_<u8,uffffffff>::value), ==, 0xffffffff );
128 |Bitwise Operations|, |Numeric Metafunction|, |numeric_cast|, |bitand_|, |bitxor_|, |shift_left|
131 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
132 Distributed under the Boost Software License, Version 1.0. (See accompanying
133 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)