]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/type/equal.cpp
4d5a18a84c4818c6c3cb4ebf25591276a0507b01
1 // Copyright Louis Dionne 2013-2017
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/assert.hpp>
6 #include <boost/hana/equal.hpp>
7 #include <boost/hana/not.hpp>
8 #include <boost/hana/not_equal.hpp> // for operator !=
9 #include <boost/hana/type.hpp>
10 namespace hana
= boost::hana
;
17 BOOST_HANA_CONSTANT_CHECK(hana::equal(hana::type_c
<T
>, hana::type_c
<T
>));
18 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(hana::type_c
<T
>, hana::type_c
<U
>)));
19 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(hana::type_c
<void>, hana::type_c
<U
>)));
20 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(hana::type_c
<T
>, hana::type_c
<void>)));
21 BOOST_HANA_CONSTANT_CHECK(hana::equal(hana::type_c
<void>, hana::type_c
<void>));
23 BOOST_HANA_CONSTANT_CHECK(hana::equal(hana::type_c
<T
&>, hana::type_c
<T
&>));
24 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(hana::type_c
<T
&>, hana::type_c
<T
&&>)));
25 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(hana::type_c
<T
const>, hana::type_c
<T
>)));
26 BOOST_HANA_CONSTANT_CHECK(hana::equal(hana::type_c
<T
const>, hana::type_c
<T
const>));
28 // make sure we don't read from a non-constexpr variable in hana::equal
29 auto t
= hana::type_c
<T
>;
30 static_assert(hana::equal(t
, hana::type_c
<T
>), "");
33 BOOST_HANA_CONSTANT_CHECK(hana::type_c
<T
> == hana::type_c
<T
>);
34 BOOST_HANA_CONSTANT_CHECK(hana::type_c
<T
> != hana::type_c
<U
>);