]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_map_update_q.cpp
2 // Copyright 2016, 2017 Peter Dimov.
4 // Distributed under the Boost Software License, Version 1.0.
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
10 #include <boost/mp11/map.hpp>
11 #include <boost/mp11/list.hpp>
12 #include <boost/mp11/integral.hpp>
13 #include <boost/core/lightweight_test_trait.hpp>
14 #include <type_traits>
18 using boost::mp11::mp_int
;
22 template<class T
, class U
> using fn
= mp_int
<U::value
+ 1>;
27 using boost::mp11::mp_map_update_q
;
28 using boost::mp11::mp_list
;
32 using M2
= mp_map_update_q
<M1
, std::pair
<char, mp_int
<0>>, Q_inc
>;
33 BOOST_TEST_TRAIT_TRUE((std::is_same
<M2
, mp_list
<std::pair
<char, mp_int
<0>>>>));
35 using M3
= mp_map_update_q
<M2
, std::pair
<char, mp_int
<0>>, Q_inc
>;
36 BOOST_TEST_TRAIT_TRUE((std::is_same
<M3
, mp_list
<std::pair
<char, mp_int
<1>>>>));
38 using M4
= mp_map_update_q
<M3
, std::pair
<int, mp_int
<0>>, Q_inc
>;
39 BOOST_TEST_TRAIT_TRUE((std::is_same
<M4
, mp_list
<std::pair
<char, mp_int
<1>>, std::pair
<int, mp_int
<0>>>>));
41 using M5
= mp_map_update_q
<M4
, std::pair
<long, mp_int
<0>>, Q_inc
>;
42 BOOST_TEST_TRAIT_TRUE((std::is_same
<M5
, mp_list
<std::pair
<char, mp_int
<1>>, std::pair
<int, mp_int
<0>>, std::pair
<long, mp_int
<0>>>>));
44 using M6
= mp_map_update_q
<M5
, std::pair
<long, mp_int
<0>>, Q_inc
>;
45 BOOST_TEST_TRAIT_TRUE((std::is_same
<M6
, mp_list
<std::pair
<char, mp_int
<1>>, std::pair
<int, mp_int
<0>>, std::pair
<long, mp_int
<1>>>>));
47 using M7
= mp_map_update_q
<M6
, std::pair
<char, mp_int
<0>>, Q_inc
>;
48 BOOST_TEST_TRAIT_TRUE((std::is_same
<M7
, mp_list
<std::pair
<char, mp_int
<2>>, std::pair
<int, mp_int
<0>>, std::pair
<long, mp_int
<1>>>>));
50 return boost::report_errors();