]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/concept/struct/unpack.cpp
30b8982f5cb694e83e33daef82e64d52553a0b15
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/concept/struct.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/integral_constant.hpp>
9 #include <boost/hana/unpack.hpp>
11 #include "minimal_struct.hpp"
12 #include <laws/base.hpp>
13 #include <support/minimal_product.hpp>
14 namespace hana
= boost::hana
;
15 using hana::test::ct_eq
;
19 constexpr auto pair
= ::minimal_product
;
20 hana::test::_injection
<0> f
{};
22 BOOST_HANA_CONSTANT_CHECK(hana::equal(
23 hana::unpack(obj(), f
),
27 BOOST_HANA_CONSTANT_CHECK(hana::equal(
28 hana::unpack(obj(ct_eq
<0>{}), f
),
29 f(pair(hana::int_c
<0>, ct_eq
<0>{}))
32 BOOST_HANA_CONSTANT_CHECK(hana::equal(
33 hana::unpack(obj(ct_eq
<0>{}, ct_eq
<1>{}), f
),
34 f(pair(hana::int_c
<0>, ct_eq
<0>{}),
35 pair(hana::int_c
<1>, ct_eq
<1>{}))
38 BOOST_HANA_CONSTANT_CHECK(hana::equal(
39 hana::unpack(obj(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}), f
),
40 f(pair(hana::int_c
<0>, ct_eq
<0>{}),
41 pair(hana::int_c
<1>, ct_eq
<1>{}),
42 pair(hana::int_c
<2>, ct_eq
<2>{}))