]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mp11/test/mp_front.cpp
2 // Copyright 2015 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/list.hpp>
12 #include <type_traits>
18 using boost::mp11::mp_list
;
19 using boost::mp11::mp_front
;
20 using boost::mp11::mp_first
;
22 using L1
= mp_list
<void>;
23 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_front
<L1
>, void>));
24 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_first
<L1
>, void>));
26 using L2
= mp_list
<int[], void, float>;
27 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_front
<L2
>, int[]>));
28 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_first
<L2
>, int[]>));
30 using L3
= std::tuple
<int>;
31 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_front
<L3
>, int>));
32 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_first
<L3
>, int>));
34 using L4
= std::pair
<char, double>;
35 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_front
<L4
>, char>));
36 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_first
<L4
>, char>));
38 using L5
= std::add_const
<void()>;
39 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_front
<L5
>, void()>));
40 BOOST_TEST_TRAIT_TRUE((std::is_same
<mp_first
<L5
>, void()>));
42 return boost::report_errors();