1 .. Metafunctions/Bitwise Operations//bitxor_
14 , typename T3 = |unspecified|
16 , typename T\ *n* = |unspecified|
20 typedef |unspecified| type;
28 Returns the result of *bitwise xor* (``^``) operation of its arguments.
36 #include <boost/mpl/bitxor.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 bitxor_<c1,\ |...|\ c\ *n*\>::type r;
77 typeof(c1::value ^ c2::value)
78 , ( c1::value ^ c2::value )
81 typedef bitxor_<c,c3,\ |...|\c\ *n*\>::type r;
83 .. ..........................................................................
87 typedef bitxor_<c1,\ |...|\ c\ *n*\> r;
97 struct r : bitxor_<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( (bitxor_<u0,u0>::value), ==, 0 );
118 BOOST_MPL_ASSERT_RELATION( (bitxor_<u1,u0>::value), ==, 1 );
119 BOOST_MPL_ASSERT_RELATION( (bitxor_<u0,u1>::value), ==, 1 );
121 BOOST_MPL_ASSERT_RELATION( (bitxor_<u0,uffffffff>::value), ==, 0xffffffff ^ 0 );
122 BOOST_MPL_ASSERT_RELATION( (bitxor_<u1,uffffffff>::value), ==, 0xffffffff ^ 1 );
123 BOOST_MPL_ASSERT_RELATION( (bitxor_<u8,uffffffff>::value), ==, 0xffffffff ^ 8 );
129 |Bitwise Operations|, |Numeric Metafunction|, |numeric_cast|, |bitand_|, |bitor_|, |shift_left|
132 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
133 Distributed under the Boost Software License, Version 1.0. (See accompanying
134 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)