]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/map/values.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / map / values.cpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
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)
4
5#include <boost/hana/assert.hpp>
6#include <boost/hana/contains.hpp>
7#include <boost/hana/equal.hpp>
8#include <boost/hana/map.hpp>
9#include <boost/hana/permutations.hpp>
10
11#include <laws/base.hpp>
12#include <support/minimal_product.hpp>
13#include <support/seq.hpp>
14namespace hana = boost::hana;
15
16
17template <int i>
18auto key() { return hana::test::ct_eq<i>{}; }
19
20template <int i>
21auto val() { return hana::test::ct_eq<-i>{}; }
22
23template <int i, int j>
24auto p() { return ::minimal_product(key<i>(), val<j>()); }
25
26int main() {
27 constexpr auto list = ::seq;
28
29 BOOST_HANA_CONSTANT_CHECK(hana::equal(
30 hana::values(hana::make_map()),
31 list()
32 ));
33
34 BOOST_HANA_CONSTANT_CHECK(hana::equal(
35 hana::values(hana::make_map(p<1, 1>())),
36 list(val<1>())
37 ));
38
39 BOOST_HANA_CONSTANT_CHECK(hana::contains(
40 hana::permutations(list(val<1>(), val<2>())),
41 hana::values(hana::make_map(p<1, 1>(), p<2, 2>()))
42 ));
43
44 BOOST_HANA_CONSTANT_CHECK(hana::contains(
45 hana::permutations(list(val<1>(), val<2>(), val<3>())),
46 hana::values(hana::make_map(p<1, 1>(), p<2, 2>(), p<3, 3>()))
47 ));
48}