]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/map/assign.copy.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/at_key.hpp>
7 #include <boost/hana/map.hpp>
8 #include <boost/hana/pair.hpp>
10 #include <laws/base.hpp>
13 namespace hana
= boost::hana
;
14 namespace test
= hana::test
;
19 using Map
= hana::map
<>;
25 using Map
= hana::map
<hana::pair
<test::ct_eq
<0>, int>>;
26 Map map0
= hana::make_map(hana::make_pair(test::ct_eq
<0>{}, 999));
27 Map map
= hana::make_map(hana::make_pair(test::ct_eq
<0>{}, 4));
29 BOOST_HANA_RUNTIME_CHECK(hana::at_key(map0
, test::ct_eq
<0>{}) == 4);
32 using Map
= hana::map
<hana::pair
<test::ct_eq
<0>, int>,
33 hana::pair
<test::ct_eq
<1>, char>>;
34 Map map0
= hana::make_map(hana::make_pair(test::ct_eq
<0>{}, 999),
35 hana::make_pair(test::ct_eq
<1>{}, 'z'));
36 Map map
= hana::make_map(hana::make_pair(test::ct_eq
<0>{}, 4),
37 hana::make_pair(test::ct_eq
<1>{}, 'a'));
39 BOOST_HANA_RUNTIME_CHECK(hana::at_key(map0
, test::ct_eq
<0>{}) == 4);
40 BOOST_HANA_RUNTIME_CHECK(hana::at_key(map0
, test::ct_eq
<1>{}) == 'a');
43 using Map
= hana::map
<hana::pair
<test::ct_eq
<0>, int>,
44 hana::pair
<test::ct_eq
<1>, char>,
45 hana::pair
<test::ct_eq
<2>, std::string
>>;
46 Map map0
= hana::make_map(hana::make_pair(test::ct_eq
<0>{}, 999),
47 hana::make_pair(test::ct_eq
<1>{}, 'z'),
48 hana::make_pair(test::ct_eq
<2>{}, std::string
{"zzzzzzzz"}));
49 Map map
= hana::make_map(hana::make_pair(test::ct_eq
<0>{}, 4),
50 hana::make_pair(test::ct_eq
<1>{}, 'a'),
51 hana::make_pair(test::ct_eq
<2>{}, std::string
{"abc"}));
53 BOOST_HANA_RUNTIME_CHECK(hana::at_key(map0
, test::ct_eq
<0>{}) == 4);
54 BOOST_HANA_RUNTIME_CHECK(hana::at_key(map0
, test::ct_eq
<1>{}) == 'a');
55 BOOST_HANA_RUNTIME_CHECK(hana::at_key(map0
, test::ct_eq
<2>{}) == "abc");