]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/experimental/view/sliced/at.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/at.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/experimental/view.hpp>
9 #include <boost/hana/integral_constant.hpp>
10 #include <boost/hana/tuple.hpp>
12 #include <laws/base.hpp>
13 #include <support/seq.hpp>
14 namespace hana
= boost::hana
;
15 using hana::test::ct_eq
;
19 auto container
= ::seq
;
22 auto storage
= container(ct_eq
<0>{});
23 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0>);
24 BOOST_HANA_CONSTANT_CHECK(hana::equal(
25 hana::at(sliced
, hana::size_c
<0>),
31 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
32 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0>);
33 BOOST_HANA_CONSTANT_CHECK(hana::equal(
34 hana::at(sliced
, hana::size_c
<0>),
38 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
39 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 1>);
40 BOOST_HANA_CONSTANT_CHECK(hana::equal(
41 hana::at(sliced
, hana::size_c
<0>),
45 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
46 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0, 1>);
47 BOOST_HANA_CONSTANT_CHECK(hana::equal(
48 hana::at(sliced
, hana::size_c
<0>),
51 BOOST_HANA_CONSTANT_CHECK(hana::equal(
52 hana::at(sliced
, hana::size_c
<1>),
56 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
57 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 1, 0>);
58 BOOST_HANA_CONSTANT_CHECK(hana::equal(
59 hana::at(sliced
, hana::size_c
<0>),
62 BOOST_HANA_CONSTANT_CHECK(hana::equal(
63 hana::at(sliced
, hana::size_c
<1>),
67 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{});
68 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0, 0>);
69 BOOST_HANA_CONSTANT_CHECK(hana::equal(
70 hana::at(sliced
, hana::size_c
<0>),
73 BOOST_HANA_CONSTANT_CHECK(hana::equal(
74 hana::at(sliced
, hana::size_c
<1>),
80 auto storage
= container(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}, ct_eq
<3>{});
81 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 1, 3>);
82 BOOST_HANA_CONSTANT_CHECK(hana::equal(
83 hana::at(sliced
, hana::size_c
<0>),
86 BOOST_HANA_CONSTANT_CHECK(hana::equal(
87 hana::at(sliced
, hana::size_c
<1>),