]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/set/unpack.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/assert.hpp>
6 #include <boost/hana/contains.hpp>
7 #include <boost/hana/permutations.hpp>
8 #include <boost/hana/set.hpp>
9 #include <boost/hana/transform.hpp>
10 #include <boost/hana/tuple.hpp>
11 #include <boost/hana/unpack.hpp>
13 #include <laws/base.hpp>
14 namespace hana
= boost::hana
;
15 using hana::test::ct_eq
;
19 hana::test::_injection
<0> f
{};
21 auto check
= [=](auto ...xs
) {
22 auto arg_perms
= hana::permutations(hana::make_tuple(xs
...));
23 auto possible_results
= hana::transform(arg_perms
, [=](auto args
) {
24 return hana::unpack(args
, f
);
27 BOOST_HANA_CONSTANT_CHECK(hana::contains(
29 hana::unpack(hana::make_set(xs
...), f
)
35 check(ct_eq
<1>{}, ct_eq
<2>{});
36 check(ct_eq
<1>{}, ct_eq
<2>{}, ct_eq
<3>{});
37 check(ct_eq
<1>{}, ct_eq
<2>{}, ct_eq
<3>{}, ct_eq
<4>{});