]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/integral_constant/operators.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / integral_constant / operators.cpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
4
5#include <boost/hana/assert.hpp>
6#include <boost/hana/integral_constant.hpp>
7
8#include <boost/hana/and.hpp>
9#include <boost/hana/div.hpp>
10#include <boost/hana/equal.hpp>
11#include <boost/hana/greater.hpp>
12#include <boost/hana/greater_equal.hpp>
13#include <boost/hana/less.hpp>
14#include <boost/hana/less_equal.hpp>
15#include <boost/hana/minus.hpp>
16#include <boost/hana/mod.hpp>
17#include <boost/hana/mult.hpp>
18#include <boost/hana/negate.hpp>
19#include <boost/hana/not.hpp>
20#include <boost/hana/not_equal.hpp>
21#include <boost/hana/or.hpp>
22#include <boost/hana/plus.hpp>
23namespace hana = boost::hana;
24
25
26// Arithmetic operators
27BOOST_HANA_CONSTANT_CHECK(+hana::int_c<1> == hana::int_c<1>);
28BOOST_HANA_CONSTANT_CHECK(-hana::int_c<1> == hana::int_c<-1>);
29BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> + hana::int_c<2> == hana::int_c<3>);
30BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> - hana::int_c<2> == hana::int_c<-1>);
31BOOST_HANA_CONSTANT_CHECK(hana::int_c<3> * hana::int_c<2> == hana::int_c<6>);
32BOOST_HANA_CONSTANT_CHECK(hana::int_c<6> / hana::int_c<3> == hana::int_c<2>);
33BOOST_HANA_CONSTANT_CHECK(hana::int_c<6> % hana::int_c<4> == hana::int_c<2>);
34BOOST_HANA_CONSTANT_CHECK(~hana::int_c<6> == hana::int_c<~6>);
35BOOST_HANA_CONSTANT_CHECK((hana::int_c<6> & hana::int_c<3>) == hana::int_c<6 & 3>);
36BOOST_HANA_CONSTANT_CHECK((hana::int_c<4> | hana::int_c<2>) == hana::int_c<4 | 2>);
37BOOST_HANA_CONSTANT_CHECK((hana::int_c<6> ^ hana::int_c<3>) == hana::int_c<6 ^ 3>);
38BOOST_HANA_CONSTANT_CHECK((hana::int_c<6> << hana::int_c<3>) == hana::int_c<(6 << 3)>);
39BOOST_HANA_CONSTANT_CHECK((hana::int_c<6> >> hana::int_c<3>) == hana::int_c<(6 >> 3)>);
40
41// Comparison operators
42BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> == hana::int_c<0>);
43BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> != hana::int_c<0>);
44BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> < hana::int_c<1>);
45BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> <= hana::int_c<1>);
46BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> <= hana::int_c<0>);
47BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> > hana::int_c<0>);
48BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> >= hana::int_c<0>);
49BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> >= hana::int_c<0>);
50
51// Logical operators
52BOOST_HANA_CONSTANT_CHECK(hana::int_c<3> || hana::int_c<0>);
53BOOST_HANA_CONSTANT_CHECK(hana::int_c<3> && hana::int_c<1>);
54BOOST_HANA_CONSTANT_CHECK(!hana::int_c<0>);
55BOOST_HANA_CONSTANT_CHECK(!!hana::int_c<3>);
56
57int main() { }