]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/detail/variadic/at.cpp
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/detail/variadic/at.hpp>
7 #include <boost/hana/assert.hpp>
8 #include <boost/hana/equal.hpp>
10 #include <laws/base.hpp>
11 namespace hana
= boost::hana
;
12 namespace vd
= hana::detail::variadic
;
13 using hana::test::ct_eq
;
16 struct non_pod
{ virtual ~non_pod() { } };
18 template <int i
> struct y
{ };
21 BOOST_HANA_CONSTANT_CHECK(hana::equal(
22 vd::at
<0>(ct_eq
<0>{}),
26 BOOST_HANA_CONSTANT_CHECK(hana::equal(
27 vd::at
<0>(ct_eq
<0>{}, ct_eq
<1>{}),
30 BOOST_HANA_CONSTANT_CHECK(hana::equal(
31 vd::at
<1>(y
<0>{}, ct_eq
<1>{}),
35 BOOST_HANA_CONSTANT_CHECK(hana::equal(
36 vd::at
<0>(ct_eq
<0>{}, y
<1>{}, y
<2>{}),
39 BOOST_HANA_CONSTANT_CHECK(hana::equal(
40 vd::at
<1>(y
<0>{}, ct_eq
<1>{}, y
<2>{}),
43 BOOST_HANA_CONSTANT_CHECK(hana::equal(
44 vd::at
<2>(y
<0>{}, y
<1>{}, ct_eq
<2>{}),
48 BOOST_HANA_CONSTANT_CHECK(hana::equal(
49 vd::at
<0>(ct_eq
<0>{}, y
<1>{}, y
<2>{}, y
<3>{}),
52 BOOST_HANA_CONSTANT_CHECK(hana::equal(
53 vd::at
<1>(y
<0>{}, ct_eq
<1>{}, y
<2>{}, y
<3>{}),
56 BOOST_HANA_CONSTANT_CHECK(hana::equal(
57 vd::at
<2>(y
<0>{}, y
<1>{}, ct_eq
<2>{}, y
<3>{}),
60 BOOST_HANA_CONSTANT_CHECK(hana::equal(
61 vd::at
<3>(y
<0>{}, y
<1>{}, y
<2>{}, ct_eq
<3>{}),
65 BOOST_HANA_CONSTANT_CHECK(hana::equal(
66 vd::at
<0>(ct_eq
<0>{}, y
<1>{}, y
<2>{}, y
<3>{}, y
<4>{}),
69 BOOST_HANA_CONSTANT_CHECK(hana::equal(
70 vd::at
<1>(y
<0>{}, ct_eq
<1>{}, y
<2>{}, y
<3>{}, y
<4>{}),
73 BOOST_HANA_CONSTANT_CHECK(hana::equal(
74 vd::at
<2>(y
<0>{}, y
<1>{}, ct_eq
<2>{}, y
<3>{}, y
<4>{}),
77 BOOST_HANA_CONSTANT_CHECK(hana::equal(
78 vd::at
<3>(y
<0>{}, y
<1>{}, y
<2>{}, ct_eq
<3>{}, y
<4>{}),
81 BOOST_HANA_CONSTANT_CHECK(hana::equal(
82 vd::at
<4>(y
<0>{}, y
<1>{}, y
<2>{}, y
<3>{}, ct_eq
<4>{}),
86 // make sure we can use non-pods on both side of the fetched object
87 vd::at
<0>(ct_eq
<0>{}, non_pod
{});
88 vd::at
<1>(non_pod
{}, ct_eq
<1>{});
90 // make sure it works with const objects