]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_pop_back.cpp
2 // Copyright 2015, 2019 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/core/lightweight_test_trait.hpp>
11 #include <boost/mp11/algorithm.hpp>
12 #include <boost/mp11/list.hpp>
13 #include <boost/mp11/utility.hpp>
14 #include <type_traits>
20 using boost::mp11::mp_list
;
21 using boost::mp11::mp_pop_back
;
23 using L1
= mp_list
<void>;
24 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_pop_back
<L1
>, mp_list
<>>));
26 using L2
= mp_list
<float, void, int[]>;
27 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_pop_back
<L2
>, mp_list
<float, void>>));
29 using L3
= std::tuple
<int>;
30 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_pop_back
<L3
>, std::tuple
<>>));
32 using L4
= std::tuple
<char, double>;
33 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_pop_back
<L4
>, std::tuple
<char>>));
35 using boost::mp11::mp_iota_c
;
36 using boost::mp11::mp_size_t
;
40 using L6
= mp_iota_c
<N
>;
41 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_pop_back
<L6
>, mp_iota_c
<N
-1>>));
43 using boost::mp11::mp_valid
;
46 BOOST_TEST_TRAIT_FALSE((mp_valid
<mp_pop_back
, L7
>));
48 return boost::report_errors();