]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_replace_front.cpp
2 // Copyright 2015, 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/algorithm.hpp>
11 #include <boost/mp11/list.hpp>
12 #include <boost/core/lightweight_test_trait.hpp>
13 #include <type_traits>
24 using boost::mp11::mp_list
;
25 using boost::mp11::mp_replace_front
;
26 using boost::mp11::mp_replace_first
;
29 using L1
= mp_list
<X1
>;
31 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L1
, void>, mp_list
<void>>));
32 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L1
, void>, mp_list
<void>>));
34 using L2
= mp_list
<X1
, X2
>;
36 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L2
, void>, mp_list
<void, X2
>>));
37 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L2
, void>, mp_list
<void, X2
>>));
39 using L3
= mp_list
<X1
, X2
, X3
>;
41 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L3
, void>, mp_list
<void, X2
, X3
>>));
42 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L3
, void>, mp_list
<void, X2
, X3
>>));
44 using L4
= mp_list
<X1
, X2
, X3
, X4
>;
46 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L4
, void>, mp_list
<void, X2
, X3
, X4
>>));
47 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L4
, void>, mp_list
<void, X2
, X3
, X4
>>));
51 using L1
= std::tuple
<X1
>;
53 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L1
, void>, std::tuple
<void>>));
54 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L1
, void>, std::tuple
<void>>));
56 using L2
= std::tuple
<X1
, X2
>;
58 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L2
, void>, std::tuple
<void, X2
>>));
59 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L2
, void>, std::tuple
<void, X2
>>));
61 using L3
= std::tuple
<X1
, X2
, X3
>;
63 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L3
, void>, std::tuple
<void, X2
, X3
>>));
64 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L3
, void>, std::tuple
<void, X2
, X3
>>));
66 using L4
= std::tuple
<X1
, X2
, X3
, X4
>;
68 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L4
, void>, std::tuple
<void, X2
, X3
, X4
>>));
69 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L4
, void>, std::tuple
<void, X2
, X3
, X4
>>));
73 using L2
= std::pair
<X1
, X2
>;
75 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_front
<L2
, void>, std::pair
<void, X2
>>));
76 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_replace_first
<L2
, void>, std::pair
<void, X2
>>));
79 return boost::report_errors();