]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/map/keys.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/equal.hpp>
8 #include <boost/hana/keys.hpp>
9 #include <boost/hana/map.hpp>
10 #include <boost/hana/permutations.hpp>
12 #include <laws/base.hpp>
13 #include <support/seq.hpp>
14 #include <support/minimal_product.hpp>
15 namespace hana
= boost::hana
;
19 auto key() { return hana::test::ct_eq
<i
>{}; }
22 auto val() { return hana::test::ct_eq
<-i
>{}; }
24 template <int i
, int j
>
25 auto p() { return ::minimal_product(key
<i
>(), val
<j
>()); }
28 constexpr auto list
= ::seq
;
30 BOOST_HANA_CONSTANT_CHECK(hana::equal(
31 hana::keys(hana::make_map()),
35 BOOST_HANA_CONSTANT_CHECK(hana::equal(
36 hana::keys(hana::make_map(p
<1, 1>())),
40 BOOST_HANA_CONSTANT_CHECK(hana::contains(
41 hana::permutations(list(key
<1>(), key
<2>())),
42 hana::keys(hana::make_map(p
<1, 1>(), p
<2, 2>()))
45 BOOST_HANA_CONSTANT_CHECK(hana::contains(
46 hana::permutations(list(key
<1>(), key
<2>(), key
<3>())),
47 hana::keys(hana::make_map(p
<1, 1>(), p
<2, 2>(), p
<3, 3>()))