]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/operator/bitwise_tests.cpp
1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
8 #include <boost/detail/lightweight_test.hpp>
9 #include <boost/phoenix/core.hpp>
10 #include <boost/phoenix/operator.hpp>
12 namespace phoenix
= boost::phoenix
;
19 using phoenix::arg_names::arg1
;
56 int& r1
= (ref(x
) &= 456)(); // should be an lvalue
57 int& r2
= (ref(x
) |= 456)(); // should be an lvalue
58 int& r3
= (ref(x
) ^= 456)(); // should be an lvalue
59 int& r4
= (ref(x
) <<= 4)(); // should be an lvalue
60 int& r5
= (ref(x
) >>= 4)(); // should be an lvalue
61 BOOST_TEST(&r1
== &r2
&& &r2
== &r3
&& &r3
== &r4
&& &r4
== &r5
);
65 BOOST_TEST((val(123) & 456)() == (123 & 456));
66 BOOST_TEST((val(123) | 456)() == (123 | 456));
67 BOOST_TEST((val(123) ^ 456)() == (123 ^ 456));
68 BOOST_TEST((val(123) << 4)() == (123 << 4));
69 BOOST_TEST((val(1230000) >> 4)() == (1230000 >> 4));
71 char const* s
= "Yabadabadoo!!!\n";
75 return boost::report_errors();