]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/experimental/view/sliced/is_empty.cpp
d6f0d267e5a33d699d119af65e9d79af00a2d27a
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/experimental/view.hpp>
7 #include <boost/hana/is_empty.hpp>
8 #include <boost/hana/not.hpp>
9 #include <boost/hana/tuple.hpp>
11 #include <support/seq.hpp>
12 namespace hana
= boost::hana
;
15 template <int> struct undefined
{ };
18 auto container
= ::seq
;
21 auto storage
= container();
22 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int>);
23 BOOST_HANA_CONSTANT_CHECK(hana::is_empty(sliced
));
25 auto storage
= container(undefined
<0>{});
26 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int>);
27 BOOST_HANA_CONSTANT_CHECK(hana::is_empty(sliced
));
29 auto storage
= container(undefined
<0>{}, undefined
<1>{});
30 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int>);
31 BOOST_HANA_CONSTANT_CHECK(hana::is_empty(sliced
));
35 auto storage
= container(undefined
<0>{});
36 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0>);
37 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(sliced
)));
39 auto storage
= container(undefined
<0>{});
40 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0, 0>);
41 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(sliced
)));
45 auto storage
= container(undefined
<0>{}, undefined
<1>{});
46 auto sliced
= hana::experimental::sliced(storage
, hana::tuple_c
<int, 0, 1>);
47 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::is_empty(sliced
)));