]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/experimental/view/sliced/unpack.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/assert.hpp>
6 #include <boost/hana/equal.hpp>
7 #include <boost/hana/experimental/view.hpp>
8 #include <boost/hana/tuple.hpp>
9 #include <boost/hana/unpack.hpp>
11 #include <laws/base.hpp>
12 #include <support/seq.hpp>
13 namespace hana
= boost::hana
;
14 using hana::test::ct_eq
;
18 auto container
= ::seq
;
19 auto f
= hana::test::_injection
<0>{};
22 auto storage
= container();
23 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int>);
24 BOOST_HANA_CONSTANT_CHECK(hana::equal(
25 hana::unpack(sliced
, f
),
31 auto storage
= container(ct_eq
<0>{});
32 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int>);
33 BOOST_HANA_CONSTANT_CHECK(hana::equal(
34 hana::unpack(sliced
, f
),
38 auto storage
= container(ct_eq
<0>{});
39 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0>);
40 BOOST_HANA_CONSTANT_CHECK(hana::equal(
41 hana::unpack(sliced
, f
),
47 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
48 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int>);
49 BOOST_HANA_CONSTANT_CHECK(hana::equal(
50 hana::unpack(sliced
, f
),
54 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
55 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0>);
56 BOOST_HANA_CONSTANT_CHECK(hana::equal(
57 hana::unpack(sliced
, f
),
61 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
62 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0, 1>);
63 BOOST_HANA_CONSTANT_CHECK(hana::equal(
64 hana::unpack(sliced
, f
),
65 f(ct_eq
<0>{}, ct_eq
<1>{})
68 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
69 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 1>);
70 BOOST_HANA_CONSTANT_CHECK(hana::equal(
71 hana::unpack(sliced
, f
),
75 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
76 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 1, 0>);
77 BOOST_HANA_CONSTANT_CHECK(hana::equal(
78 hana::unpack(sliced
, f
),
79 f(ct_eq
<1>{}, ct_eq
<0>{})
84 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{});
85 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int>);
86 BOOST_HANA_CONSTANT_CHECK(hana::equal(
87 hana::unpack(sliced
, f
),
91 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{});
92 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0>);
93 BOOST_HANA_CONSTANT_CHECK(hana::equal(
94 hana::unpack(sliced
, f
),
98 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{});
99 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 1>);
100 BOOST_HANA_CONSTANT_CHECK(hana::equal(
101 hana::unpack(sliced
, f
),
105 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{});
106 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 2>);
107 BOOST_HANA_CONSTANT_CHECK(hana::equal(
108 hana::unpack(sliced
, f
),
112 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{});
113 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0, 2>);
114 BOOST_HANA_CONSTANT_CHECK(hana::equal(
115 hana::unpack(sliced
, f
),
116 f(ct_eq
<0>{}, ct_eq
<2>{})
119 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{});
120 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 1, 1>);
121 BOOST_HANA_CONSTANT_CHECK(hana::equal(
122 hana::unpack(sliced
, f
),
123 f(ct_eq
<1>{}, ct_eq
<1>{})
128 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}, ct_eq
<3>{});
129 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 3, 1, 0, 2, 2>);
130 BOOST_HANA_CONSTANT_CHECK(hana::equal(
131 hana::unpack(sliced
, f
),
132 f(ct_eq
<3>{}, ct_eq
<1>{}, ct_eq
<0>{}, ct_eq
<2>{}, ct_eq
<2>{})