]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Copyright Louis Dionne 2013-2016 |
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> | |
23 | namespace hana = boost::hana; | |
24 | ||
25 | ||
26 | // Arithmetic operators | |
27 | BOOST_HANA_CONSTANT_CHECK(+hana::int_c<1> == hana::int_c<1>); | |
28 | BOOST_HANA_CONSTANT_CHECK(-hana::int_c<1> == hana::int_c<-1>); | |
29 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> + hana::int_c<2> == hana::int_c<3>); | |
30 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> - hana::int_c<2> == hana::int_c<-1>); | |
31 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<3> * hana::int_c<2> == hana::int_c<6>); | |
32 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<6> / hana::int_c<3> == hana::int_c<2>); | |
33 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<6> % hana::int_c<4> == hana::int_c<2>); | |
34 | BOOST_HANA_CONSTANT_CHECK(~hana::int_c<6> == hana::int_c<~6>); | |
35 | BOOST_HANA_CONSTANT_CHECK((hana::int_c<6> & hana::int_c<3>) == hana::int_c<6 & 3>); | |
36 | BOOST_HANA_CONSTANT_CHECK((hana::int_c<4> | hana::int_c<2>) == hana::int_c<4 | 2>); | |
37 | BOOST_HANA_CONSTANT_CHECK((hana::int_c<6> ^ hana::int_c<3>) == hana::int_c<6 ^ 3>); | |
38 | BOOST_HANA_CONSTANT_CHECK((hana::int_c<6> << hana::int_c<3>) == hana::int_c<(6 << 3)>); | |
39 | BOOST_HANA_CONSTANT_CHECK((hana::int_c<6> >> hana::int_c<3>) == hana::int_c<(6 >> 3)>); | |
40 | ||
41 | // Comparison operators | |
42 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> == hana::int_c<0>); | |
43 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> != hana::int_c<0>); | |
44 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> < hana::int_c<1>); | |
45 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> <= hana::int_c<1>); | |
46 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> <= hana::int_c<0>); | |
47 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> > hana::int_c<0>); | |
48 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<1> >= hana::int_c<0>); | |
49 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<0> >= hana::int_c<0>); | |
50 | ||
51 | // Logical operators | |
52 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<3> || hana::int_c<0>); | |
53 | BOOST_HANA_CONSTANT_CHECK(hana::int_c<3> && hana::int_c<1>); | |
54 | BOOST_HANA_CONSTANT_CHECK(!hana::int_c<0>); | |
55 | BOOST_HANA_CONSTANT_CHECK(!!hana::int_c<3>); | |
56 | ||
57 | int main() { } |