]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/detail/variadic/drop_into.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/drop_into.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() { } };
20 hana::test::_injection
<0> f
{};
22 BOOST_HANA_CONSTANT_CHECK(hana::equal(
23 vd::drop_into
<0>(f
)(),
26 BOOST_HANA_CONSTANT_CHECK(hana::equal(
27 vd::drop_into
<0>(f
)(ct_eq
<0>{}),
30 BOOST_HANA_CONSTANT_CHECK(hana::equal(
31 vd::drop_into
<0>(f
)(ct_eq
<0>{}, ct_eq
<1>{}),
32 f(ct_eq
<0>{}, ct_eq
<1>{})
34 BOOST_HANA_CONSTANT_CHECK(hana::equal(
35 vd::drop_into
<0>(f
)(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}),
36 f(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{})
40 BOOST_HANA_CONSTANT_CHECK(hana::equal(
41 vd::drop_into
<1>(f
)(ct_eq
<0>{}),
44 BOOST_HANA_CONSTANT_CHECK(hana::equal(
45 vd::drop_into
<1>(f
)(ct_eq
<0>{}, ct_eq
<1>{}),
48 BOOST_HANA_CONSTANT_CHECK(hana::equal(
49 vd::drop_into
<1>(f
)(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}),
50 f(ct_eq
<1>{}, ct_eq
<2>{})
52 BOOST_HANA_CONSTANT_CHECK(hana::equal(
53 vd::drop_into
<1>(f
)(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}, ct_eq
<3>{}),
54 f(ct_eq
<1>{}, ct_eq
<2>{}, ct_eq
<3>{})
58 BOOST_HANA_CONSTANT_CHECK(hana::equal(
59 vd::drop_into
<2>(f
)(ct_eq
<0>{}, ct_eq
<1>{}),
62 BOOST_HANA_CONSTANT_CHECK(hana::equal(
63 vd::drop_into
<2>(f
)(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}),
66 BOOST_HANA_CONSTANT_CHECK(hana::equal(
67 vd::drop_into
<2>(f
)(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}, ct_eq
<3>{}),
68 f(ct_eq
<2>{}, ct_eq
<3>{})
70 BOOST_HANA_CONSTANT_CHECK(hana::equal(
71 vd::drop_into
<2>(f
)(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{}, ct_eq
<3>{}, ct_eq
<4>{}),
72 f(ct_eq
<2>{}, ct_eq
<3>{}, ct_eq
<4>{})
75 // make sure we can use non-pods
76 vd::drop_into
<1>(f
)(ct_eq
<0>{}, non_pod
{});
77 vd::drop_into
<1>(f
)(non_pod
{}, ct_eq
<1>{});