]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/ext/boost/mpl/integral_c/logical.cpp
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)
5 #include <boost/hana/ext/boost/mpl/integral_c.hpp>
7 #include <boost/hana/assert.hpp>
8 #include <boost/hana/equal.hpp>
9 #include <boost/hana/eval_if.hpp>
10 #include <boost/hana/functional/always.hpp>
11 #include <boost/hana/not.hpp>
12 #include <boost/hana/tuple.hpp>
14 #include <laws/base.hpp>
15 #include <laws/logical.hpp>
17 #include <boost/mpl/bool.hpp>
18 #include <boost/mpl/int.hpp>
19 #include <boost/mpl/integral_c.hpp>
20 namespace hana
= boost::hana
;
21 namespace mpl
= boost::mpl
;
27 auto t
= hana::test::ct_eq
<3>{};
28 auto e
= hana::test::ct_eq
<4>{};
30 BOOST_HANA_CONSTANT_CHECK(hana::equal(
31 hana::eval_if(mpl::true_
{}, hana::always(t
), hana::always(e
)),
35 BOOST_HANA_CONSTANT_CHECK(hana::equal(
36 hana::eval_if(mpl::false_
{}, hana::always(t
), hana::always(e
)),
43 BOOST_HANA_CONSTANT_CHECK(hana::equal(
44 hana::not_(mpl::true_
{}),
47 BOOST_HANA_CONSTANT_CHECK(hana::equal(
48 hana::not_(mpl::false_
{}),
54 hana::test::TestLogical
<hana::ext::boost::mpl::integral_c_tag
<int>>{
56 mpl::int_
<-2>{}, mpl::integral_c
<int, 0>{}, mpl::integral_c
<int, 3>{}
60 hana::test::TestLogical
<hana::ext::boost::mpl::integral_c_tag
<bool>>{
62 mpl::true_
{}, mpl::false_
{},
63 mpl::integral_c
<bool, true>{}, mpl::integral_c
<bool, false>{}